|
From: <pa...@us...> - 2003-08-16 20:10:50
|
Update of /cvsroot/emc/rtapi/src/rtapi
In directory sc8-pr-cvs1:/tmp/cvs-serv20328
Modified Files:
rtai_rtapi.c rtapi_app.h
Log Message:
Changed vsprintf to use the kernel implimentation, vsnprintf
Index: rtai_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtai_rtapi.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** rtai_rtapi.c 16 Aug 2003 19:38:25 -0000 1.25
--- rtai_rtapi.c 16 Aug 2003 20:08:33 -0000 1.26
***************
*** 70,77 ****
#endif
- /* declare vsprintf() explicitly instead of including all of <stdio.h>,
- since we don't need all of it and it may cause problems */
- extern int vsprintf(char *s, const char *format, va_list arg);
-
#include "rtapi.h" /* these decls */
--- 70,73 ----
***************
*** 602,609 ****
/* using a static buffer means that these functions are not
re-entrant, would be better to allocate buffer on the stack */
- /* the call to vsprintf() will put arbitrarily many characters into
- 'buffer', and we can't easily check how many beforehand. This may
- cause a buffer overflow. The correct way to do this is as in
- Exercise 7-3 in K&R's _C Language, 2nd Ed_ book */
#define BUFFERLEN 256
--- 598,601 ----
***************
*** 615,619 ****
va_start(args, fmt);
! vsprintf(buffer, fmt, args);
rt_printk(buffer);
va_end(args);
--- 607,611 ----
va_start(args, fmt);
! vsnprintf(buffer, BUFFERLEN, fmt, args);
rt_printk(buffer);
va_end(args);
Index: rtapi_app.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi_app.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rtapi_app.h 16 Aug 2003 19:38:25 -0000 1.2
--- rtapi_app.h 16 Aug 2003 20:08:33 -0000 1.3
***************
*** 17,23 ****
extern void rtapi_app_return(void);
- #ifndef MODULE_LICENSE
- MODULE_LICENSE("GPL");
- #endif
-
#endif /* RTAPI_APP_H */
--- 17,19 ----
|