comparison lib/vsnprintf.c @ 9831:787bf3487678

Use module 'EOVERFLOW' rather than defining an EOVERFLOW replacement in the C code.
author Bruno Haible <bruno@clisp.org>
date Sun, 30 Mar 2008 15:18:13 +0200
parents 8c96722f8bd0
children e8d2c6fc33ad
comparison
equal deleted inserted replaced
9830:72d681c41161 9831:787bf3487678
1 /* Formatted output to strings. 1 /* Formatted output to strings.
2 Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc. 2 Copyright (C) 2004, 2006-2008 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
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option) 7 the Free Software Foundation; either version 2, or (at your option)
28 #include <stdarg.h> 28 #include <stdarg.h>
29 #include <stdlib.h> 29 #include <stdlib.h>
30 #include <string.h> 30 #include <string.h>
31 31
32 #include "vasnprintf.h" 32 #include "vasnprintf.h"
33
34 /* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
35 #ifndef EOVERFLOW
36 # define EOVERFLOW E2BIG
37 #endif
38 33
39 /* Print formatted output to string STR. Similar to vsprintf, but 34 /* Print formatted output to string STR. Similar to vsprintf, but
40 additional length SIZE limit how much is written into STR. Returns 35 additional length SIZE limit how much is written into STR. Returns
41 string length of formatted string (which may be larger than SIZE). 36 string length of formatted string (which may be larger than SIZE).
42 STR may be NULL, in which case nothing will be written. On error, 37 STR may be NULL, in which case nothing will be written. On error,