aboutsummaryrefslogtreecommitdiff
path: root/tests/core/test_sscanf_whitespace.in
blob: 8bcf1c7b23a29cc1d7956bd505e74fa078ba0035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>

int main() {
  short int x;
  short int y;

  const char* buffer[] = {"173,16",      "    16,173",   "183,   173",
                          "  17,   287", " 98,  123,   "};

  for (int i = 0; i < 5; ++i) {
    sscanf(buffer[i], "%hd,%hd", &x, &y);
    printf("%d:%d,%d ", i, x, y);
  }

  return 0;
}