Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F10341828
snprintf.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
524 B
Referenced Files
None
Subscribers
None
snprintf.c
View Options
/* Provide a version vfprintf in terms of _doprnt.
By Kaveh Ghazi (ghazi@caip.rutgers.edu) 3/29/98
Copyright (C) 1998 Free Software Foundation, Inc.
*/
#include
"defines.h"
int
rpl_snprintf
(
char
*
buff
,
size_t
size
,
const
char
*
fmt
,
...)
{
static
char
temp
[
BUFSIZ
];
/* a temp (large buffer) */
int
result
;
va_list
ap
;
va_start
(
ap
,
fmt
);
result
=
vsprintf
(
temp
,
fmt
,
ap
);
strncpy
(
buff
,
temp
,
size
-
1
);
/* copy at most n */
buff
[
size
-
1
]
=
'\0'
;
/* ensure \0 at end */
va_end
(
ap
);
return
result
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Wed, Jul 2, 21:14 (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2755205
Default Alt Text
snprintf.c (524 B)
Attached To
Mode
rDARKBOT Darkbot
Attached
Detach File
Event Timeline
Log In to Comment