summaryrefslogtreecommitdiffstats
path: root/gl/vsnprintf.c
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2010-04-08 01:11:46 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2010-04-13 01:26:35 (GMT)
commit74da141e618ef99959d509cb2e7be35a348a39db (patch)
tree88ebc38b381a1021fc2d74864a71e230ae591c3d /gl/vsnprintf.c
parentc63a4f726a0b6ad8cf6040f947754a81fd4683bb (diff)
downloadmonitoring-plugins-74da141e618ef99959d509cb2e7be35a348a39db.tar.gz
Sync with the latest Gnulib code (177f525)
Signed-off-by: Thomas Guyot-Sionnest <dermoth@aei.ca>
Diffstat (limited to 'gl/vsnprintf.c')
-rw-r--r--gl/vsnprintf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gl/vsnprintf.c b/gl/vsnprintf.c
index 02af252..d447cc2 100644
--- a/gl/vsnprintf.c
+++ b/gl/vsnprintf.c
@@ -1,5 +1,5 @@
1/* Formatted output to strings. 1/* Formatted output to strings.
2 Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc. 2 Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
3 Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>. 3 Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
@@ -52,11 +52,11 @@ vsnprintf (char *str, size_t size, const char *format, va_list args)
52 if (output != str) 52 if (output != str)
53 { 53 {
54 if (size) 54 if (size)
55 { 55 {
56 size_t pruned_len = (len < size ? len : size - 1); 56 size_t pruned_len = (len < size ? len : size - 1);
57 memcpy (str, output, pruned_len); 57 memcpy (str, output, pruned_len);
58 str[pruned_len] = '\0'; 58 str[pruned_len] = '\0';
59 } 59 }
60 60
61 free (output); 61 free (output);
62 } 62 }