commit f98c94fb0adc07bd58c3bd0b2debb4d7c8e8c784
parent faa4cbb0fdae435112893c37c78156e1f65504f3
Author: Naveen Narayanan <zerous@nocebo.space>
Date: Sat, 25 Sep 2021 16:41:40 +0200
Use descriptive names for function params
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/finger.c b/finger.c
@@ -21,26 +21,26 @@ usage(void)
}
int
-cred(char *u, char *h, char *s)
+cred(char *username, char *hostname, char *input)
{
char *a;
- if (!(a = strchr(s, '@'))) {
+ if (!(a = strchr(input, '@'))) {
fprintf(stderr, "hostname not found\n");
return 0;
}
- if (a - s >= 32) {
+ if (a - input >= 32) {
fprintf(stderr, "username too long\n");
- return 1;
+ return 0;
}
- memcpy(u, s, a - s);
+ memcpy(username, input, a - input);
if (strlen(a+1) > MAXHOSTNAMELEN) {
fprintf(stderr, "hostname too long\n");
return 0;
}
- strcpy(h, a+1);
+ strcpy(hostname, a+1);
return 1;
}