Skip to content
Permalink
1a511d3105
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
30 lines (24 sloc) 566 Bytes
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main (void)
{
int matches;
char str[10];
str[0] = '\0';
matches = -9;
matches = sscanf ("x ]", "%[^] ]", str);
printf ("Matches = %d, string str = \"%s\".\n", matches, str);
printf ("str should be \"x\".\n");
if (strcmp (str, "x"))
abort ();
str[0] = '\0';
matches = -9;
matches = sscanf (" ] x", "%[] ]", str);
printf ("Matches = %d, string str = \"%s\".\n", matches, str);
printf ("str should be \" ] \".\n");
if (strcmp (str, " ] "))
abort ();
return 0;
}