Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F22791411
snprintf.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
580 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
"ansidecl.h"
#include
<stdarg.h>
#include
<stdio.h>
#undef snprintf
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
Mon, Feb 2, 15:27 (23 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3385837
Default Alt Text
snprintf.c (580 B)
Attached To
Mode
rDARKBOT Darkbot
Attached
Detach File
Event Timeline
Log In to Comment