diff options
author | Martin Baulig <martin@src.gnome.org> | 1998-05-19 22:44:20 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 1998-05-19 22:44:20 +0000 |
commit | 6eec1a0c05185e7fa8966b1727c5599061813ba2 (patch) | |
tree | 4a301c0e062abc66e9d82a9ca2861dfcdc3264ed | |
parent | b1b2b62910a8108dcb7cc18775eb4d1b441ec3ac (diff) | |
download | gnome-common-6eec1a0c05185e7fa8966b1727c5599061813ba2.tar.gz |
Added prototype for systems defining __STDC__.
* vsnprintf.c (vsnprintf): Added prototype for systems
defining __STDC__.
* vsnprintf.c (snprintf): Moved toward the end of the
file, that the compiler gets correct prototype for
vsnprintf().
svn path=/trunk/; revision=206
-rw-r--r-- | support/ChangeLog | 9 | ||||
-rw-r--r-- | support/vsnprintf.c | 46 |
2 files changed, 35 insertions, 20 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index bedffb5..e5da677 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,12 @@ +1998-05-19 Martin Baulig <martin@home-of-linux.org> + + * vsnprintf.c (vsnprintf): Added prototype for systems + defining __STDC__. + + * vsnprintf.c (snprintf): Moved toward the end of the + file, that the compiler gets correct prototype for + vsnprintf(). + 1998-05-12 Kjartan Maraas <kmaraas@fib.hl.no> * argp-help.c (argp_doc): Backed out previous "fix". :-) diff --git a/support/vsnprintf.c b/support/vsnprintf.c index 0231879..a2dfb4e 100644 --- a/support/vsnprintf.c +++ b/support/vsnprintf.c @@ -97,32 +97,14 @@ mcleanup(str, n, p) int #if __STDC__ -snprintf(char *str, size_t n, char const *fmt, ...) -#else -snprintf(str, n, fmt, va_alist) - char *str; - size_t n; - char *fmt; - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); +vsnprintf(char *str, size_t n, char const *fmt, va_list ap) #else - va_start(ap); -#endif - - return (vsnprintf(str, n, fmt, ap)); - va_end(ap); -} - -int vsnprintf(str, n, fmt, ap) char *str; size_t n; char *fmt; char *ap; +#endif { struct sigaction osa, nsa; char *p; @@ -149,3 +131,27 @@ vsnprintf(str, n, fmt, ap) return (ret); } +int +#if __STDC__ +snprintf(char *str, size_t n, char const *fmt, ...) +#else +snprintf(str, n, fmt, va_alist) + char *str; + size_t n; + char *fmt; + va_dcl +#endif +{ + va_list ap; +#if __STDC__ + va_start(ap, fmt); +#else + va_start(ap); +#endif + + return (vsnprintf(str, n, fmt, ap)); + va_end(ap); +} + + + |