diff options
Diffstat (limited to 'man3/strcmp.3')
-rw-r--r-- | man3/strcmp.3 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/man3/strcmp.3 b/man3/strcmp.3 index 2a58c37e0..a6cd2c758 100644 --- a/man3/strcmp.3 +++ b/man3/strcmp.3 @@ -162,28 +162,28 @@ $ \fB./string_comp ABC AB 2\fP .\" SRC BEGIN (string_comp.c) .EX /* string_comp.c - +\& Licensed under GNU General Public License v2 or later. */ #include <stdio.h> #include <stdlib.h> #include <string.h> - +\& int main(int argc, char *argv[]) { int res; - +\& if (argc < 3) { fprintf(stderr, "Usage: %s <str1> <str2> [<len>]\en", argv[0]); exit(EXIT_FAILURE); } - +\& if (argc == 3) res = strcmp(argv[1], argv[2]); else res = strncmp(argv[1], argv[2], atoi(argv[3])); - +\& if (res == 0) { printf("<str1> and <str2> are equal"); if (argc > 3) @@ -194,7 +194,7 @@ main(int argc, char *argv[]) } else { printf("<str1> is greater than <str2> (%d)\en", res); } - +\& exit(EXIT_SUCCESS); } .EE |