more stuff
This commit is contained in:
11
streq/Makefile
Normal file
11
streq/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
all: streq
|
||||
|
||||
clean:
|
||||
rm -r streq
|
||||
|
||||
sane: streq
|
||||
|
||||
streq: streq.c
|
||||
$(CC) -o streq streq.c
|
||||
|
||||
.PHONY: all clean sane
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
#include "libio.h"
|
||||
#include <stdio.h> /* fprintf(3) */
|
||||
#include <stdlib.h> /* stderr, stdin, stdout */
|
||||
#include <sysexits.h> /* EX_USAGE */
|
||||
|
||||
static char *program_name = "streq";
|
||||
|
||||
@@ -9,11 +9,8 @@ int main(int argc, char *argv[]){
|
||||
int j;
|
||||
|
||||
if(argc < 3){
|
||||
write(2, "Usage: ", 7);
|
||||
if(argv[0] == NULL)
|
||||
argv[0] = program_name;
|
||||
fdprint(2, argv[0]);
|
||||
write(2, " [strings...]\n", 14);
|
||||
fprintf(stderr, "Usage: %s [string] [string...]\n",
|
||||
argv[0] == NULL ? program_name : argv[0]);
|
||||
return EX_USAGE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user