summaryrefslogtreecommitdiffstats
path: root/gl/vsnprintf.c
diff options
context:
space:
mode:
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 }