commit ea732482a4e92f463b89bbbd2215c12d67f3547f
parent f19055b6e9735d304e20629955e65833df1a8699
Author: Naveen Narayanan <zerous@nocebo.space>
Date: Sat, 25 Sep 2021 18:19:43 +0200
Localize buffer
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/finger.c b/finger.c
@@ -12,7 +12,6 @@
#include <unistd.h>
#define BUFSZ 128
-char buf[BUFSZ];
void
usage(void)
@@ -51,11 +50,12 @@ main(int argc, char **argv)
{
struct addrinfo hints = { 0 };
struct addrinfo *res, *p;
- char user[32], hostname[MAXHOSTNAMELEN+1];
- char *msg = buf;
+ char buf[BUFSZ], hostname[MAXHOSTNAMELEN+1], user[32];
+ char *msg;
int status, sockfd, byt, len, err, tosend;
err = 0;
+ msg = buf;
if (argc != 2)
usage();