summaryrefslogtreecommitdiffstats
path: root/gl/snprintf.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/snprintf.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/snprintf.c')
-rw-r--r--gl/snprintf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gl/snprintf.c b/gl/snprintf.c
index dafbda8..810ca14 100644
--- a/gl/snprintf.c
+++ b/gl/snprintf.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 Paul Eggert. 3 Written by Simon Josefsson and Paul Eggert.
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
@@ -53,11 +53,11 @@ snprintf (char *str, size_t size, const char *format, ...)
53 if (output != str) 53 if (output != str)
54 { 54 {
55 if (size) 55 if (size)
56 { 56 {
57 size_t pruned_len = (len < size ? len : size - 1); 57 size_t pruned_len = (len < size ? len : size - 1);
58 memcpy (str, output, pruned_len); 58 memcpy (str, output, pruned_len);
59 str[pruned_len] = '\0'; 59 str[pruned_len] = '\0';
60 } 60 }
61 61
62 free (output); 62 free (output);
63 } 63 }