diff options
Diffstat (limited to 'gl/snprintf.c')
-rw-r--r-- | gl/snprintf.c | 12 |
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 | } |