diff options
| author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2010-04-07 21:11:46 -0400 |
|---|---|---|
| committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2010-04-12 21:26:35 -0400 |
| commit | 74da141e618ef99959d509cb2e7be35a348a39db (patch) | |
| tree | 88ebc38b381a1021fc2d74864a71e230ae591c3d /gl/vsnprintf.c | |
| parent | c63a4f726a0b6ad8cf6040f947754a81fd4683bb (diff) | |
| download | monitoring-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.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gl/vsnprintf.c b/gl/vsnprintf.c index 02af2520..d447cc2d 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 | } |
