Blame stdio-common/bug8.c
|
Packit |
6c4009 |
#include <stdio.h>
|
|
Packit |
6c4009 |
#include <string.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
int
|
|
Packit |
6c4009 |
main(int argc, char *argv[])
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
char buf[100];
|
|
Packit |
6c4009 |
int point, x, y;
|
|
Packit |
6c4009 |
int status = 0;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
sscanf("0x10 10", "%x %x", &x, &y);
|
|
Packit |
6c4009 |
sprintf(buf, "%d %d", x, y);
|
|
Packit |
6c4009 |
puts (buf);
|
|
Packit |
6c4009 |
status |= strcmp (buf, "16 16");
|
|
Packit |
6c4009 |
sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y);
|
|
Packit |
6c4009 |
sprintf(buf, "%d %d %d", point, x, y);
|
|
Packit |
6c4009 |
status |= strcmp (buf, "0 1234 9876");
|
|
Packit |
6c4009 |
puts (buf);
|
|
Packit |
6c4009 |
sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y);
|
|
Packit |
6c4009 |
sprintf(buf, "%d %d %d", point, x, y);
|
|
Packit |
6c4009 |
status |= strcmp (buf, "1 1234 9876");
|
|
Packit |
6c4009 |
puts (buf);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
puts (status ? "Test failed" : "Test passed");
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
return status;
|
|
Packit |
6c4009 |
}
|