aboutsummaryrefslogtreecommitdiff
path: root/stdio-common
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/scanf9.c31
-rw-r--r--stdio-common/tst-printf.c16
-rw-r--r--stdio-common/tstdiomisc.c6
3 files changed, 30 insertions, 23 deletions
diff --git a/stdio-common/scanf9.c b/stdio-common/scanf9.c
index 52bff08e18..7aca354d2a 100644
--- a/stdio-common/scanf9.c
+++ b/stdio-common/scanf9.c
@@ -2,22 +2,29 @@
#include <stdlib.h>
#include <string.h>
-int main(int argc, char *argv[]) {
- int matches;
- char str[10];
+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 ();
+ 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 ();
- exit(0);
+ matches = sscanf (" ] x", "%[] ]", str);
+ printf ("Matches = %d, string str = \"%s\".\n", matches, str);
+ printf ("str should be \" ] \".\n");
+
+ if (strcmp (str, " ] "))
+ abort ();
+
return 0;
}
diff --git a/stdio-common/tst-printf.c b/stdio-common/tst-printf.c
index f0f0e55bc4..7a99efc6c9 100644
--- a/stdio-common/tst-printf.c
+++ b/stdio-common/tst-printf.c
@@ -28,11 +28,11 @@
#include <float.h>
-void rfg1 (void);
-void rfg2 (void);
+static void rfg1 (void);
+static void rfg2 (void);
-void
+static void
fmtchk (const char *fmt)
{
(void) fputs(fmt, stdout);
@@ -41,7 +41,7 @@ fmtchk (const char *fmt)
(void) printf("'\n");
}
-void
+static void
fmtst1chk (const char *fmt)
{
(void) fputs(fmt, stdout);
@@ -50,7 +50,7 @@ fmtst1chk (const char *fmt)
(void) printf("'\n");
}
-void
+static void
fmtst2chk (const char *fmt)
{
(void) fputs(fmt, stdout);
@@ -82,7 +82,7 @@ fmtst2chk (const char *fmt)
* This exercises the output formatting code.
*/
-void
+static void
fp_test (void)
{
int i, j, k, l;
@@ -292,7 +292,7 @@ I am ready for my first lesson today.";
return result != 0;
}
-void
+static void
rfg1 (void)
{
char buf[100];
@@ -317,7 +317,7 @@ rfg1 (void)
printf ("got: '%s', expected: '%s'\n", buf, "3E+01");
}
-void
+static void
rfg2 (void)
{
int prec;
diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
index 55d77b0f29..452a21f9cb 100644
--- a/stdio-common/tstdiomisc.c
+++ b/stdio-common/tstdiomisc.c
@@ -4,7 +4,7 @@
#include <string.h>
#include <wchar.h>
-int
+static int
t1 (void)
{
int n = -1;
@@ -14,7 +14,7 @@ t1 (void)
return n != 5;
}
-int
+static int
t2 (void)
{
int result = 0;
@@ -46,7 +46,7 @@ t2 (void)
return result;
}
-int
+static int
F (void)
{
char buf[20];