1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00
Files
amiga-clib2/test_programs/sprintf_test.c
Olaf Barthel 6a2db55fc2 - Added the test program for the sprintf() buffer flush bug, courtesy of
Jens Langner.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14725 87f5fb63-7c3d-0410-a384-fd976d0f7a62
2004-09-10 07:41:13 +00:00

26 lines
311 B
C

#include <string.h>
#include <stdio.h>
static char buf[256];
void addsomething(void)
{
char *p = &buf[strlen(buf)];
sprintf(p, "yeah");
}
int main(void)
{
buf[0] = '\0';
addsomething();
printf("1: [%s]\n", buf);
sprintf(buf, "");
addsomething();
printf("2: [%s]\n", buf);
return (0);
}