File: scanf8.c

package info (click to toggle)
glibc 2.41-8
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 299,920 kB
  • sloc: ansic: 1,050,402; asm: 238,842; makefile: 20,355; python: 13,537; sh: 11,812; cpp: 5,197; awk: 1,795; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (16 lines) | stat: -rw-r--r-- 336 bytes parent folder | download | duplicates (45)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int
main (int argc, char *argv[])
{
  int ret;
  char buf [1024] = "Ooops";

  ret = sscanf ("static char Term_bits[] = {", "static char %s = {", buf);
  printf ("ret: %d, name: %s\n", ret, buf);
  if (ret != 1 || strcmp (buf, "Term_bits[]") != 0)
    abort ();
  return 0;
}