1
0

more stuff

This commit is contained in:
dtb
2022-09-18 12:17:49 -04:00
parent 4206d6dee5
commit 3b9ff7ddb4
6 changed files with 48 additions and 16 deletions

11
streq/Makefile Normal file
View 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

View File

@@ -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;
}