comparison libiberty/vsnprintf.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Implement the vsnprintf function. 1 /* Implement the vsnprintf function.
2 Copyright (C) 2003, 2004, 2005, 2011 Free Software Foundation, Inc. 2 Copyright (C) 2003-2017 Free Software Foundation, Inc.
3 Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>. 3 Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
4 4
5 This file is part of the libiberty library. This library is free 5 This file is part of the libiberty library. This library is free
6 software; you can redistribute it and/or modify it under the 6 software; you can redistribute it and/or modify it under the
7 terms of the GNU General Public License as published by the 7 terms of the GNU General Public License as published by the
93 93
94 static int ATTRIBUTE_PRINTF_3 94 static int ATTRIBUTE_PRINTF_3
95 checkit (char *s, size_t n, const char *format, ...) 95 checkit (char *s, size_t n, const char *format, ...)
96 { 96 {
97 int result; 97 int result;
98 VA_OPEN (ap, format); 98 va_list ap;
99 VA_FIXEDARG (ap, char *, s); 99 va_start (ap, format);
100 VA_FIXEDARG (ap, size_t, n);
101 VA_FIXEDARG (ap, const char *, format);
102 result = vsnprintf (s, n, format, ap); 100 result = vsnprintf (s, n, format, ap);
103 VA_CLOSE (ap); 101 va_end (ap);
104 return result; 102 return result;
105 } 103 }
106 104
107 extern int main (void); 105 extern int main (void);
108 int 106 int