mirror of https://github.com/adtools/clib2.git
26 lines
311 B
C
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);
|
|
}
|