[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#361925: Reason for another [v]snprintf implementation?



Is there a particular reason that we need this vsnprintf implementation?
Could we just use the one included in libc?

If libc's implementation is satisfactory, a patch is attached that uses
it.  Note that this is not the only bug present:

/usr/bin/gcc-4.2 -I.. -I. -I./include -I./common -D_FILE_OFFSET_BITS=64 -I/usr/include -g -W -Wall -Werror -Wno-unused -g -O2 -D_FILE_OFFSET_BITS=64 -g -W -Wall -Werror -Wno-unused -DHAVE_CONFIG_H -c ./common/lpd_jobs.c -o lpd_jobs.o
cc1: warnings being treated as errors
./common/lpd_jobs.c: In function 'Move_job':
./common/lpd_jobs.c:3082: warning: format '%s' expects type 'char *', but argument 4 has type 'struct line_list *'
./common/lpd_jobs.c:3082: warning: format '%s' expects type 'char *', but argument 4 has type 'struct line_list *'

is also present; I may not get to that part, so feel free to fix it,
should you have the time.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
Screw you, AACS LA: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
--- lprng.old/src/include/plp_snprintf.h	2004-09-24 20:20:00.000000000 +0000
+++ lprng-3.8.28dfsg.1/src/include/plp_snprintf.h	2007-05-19 19:28:03.000000000 +0000
@@ -12,35 +12,11 @@
 #ifndef _PLP_SNPRINTF_
 #define _PLP_SNPRINTF_
 
-/* PRO TO TYPES */
-/* VARARGS3 */
-#ifdef HAVE_STDARGS
- int plp_vsnprintf(char *str, size_t count, const char *fmt, va_list args)
-#else
- int plp_vsnprintf(char *str, size_t count, const char *fmt, va_list args)
-#endif
+#include <stdio.h>
 
-;
-/* VARARGS3 */
-#ifdef HAVE_STDARGS
- int plp_unsafe_vsnprintf(char *str, size_t count, const char *fmt, va_list args)
-#else
- int plp_unsafe_vsnprintf(char *str, size_t count, const char *fmt, va_list args)
-#endif
-;
-/* VARARGS3 */
-#ifdef HAVE_STDARGS
- int plp_snprintf (char *str,size_t count,const char *fmt,...)
-#else
- int plp_snprintf (va_alist) va_dcl
-#endif
-;
-/* VARARGS3 */
-#ifdef HAVE_STDARGS
- int plp_unsafe_snprintf (char *str,size_t count,const char *fmt,...)
-#else
- int plp_unsafe_snprintf (va_alist) va_dcl
-#endif
-;
+#define plp_vsnprintf vsnprintf
+#define plp_unsafe_vsnprintf vsnprintf
+#define plp_snprintf snprintf
+#define plp_unsafe_snprintf snprintf
 
 #endif

Attachment: signature.asc
Description: Digital signature


Reply to: