- Fix warnings reported by the gcc analyzer.

This commit is contained in:
W.C.A. Wijngaards
2021-06-23 18:02:02 +02:00
parent 7694998ea9
commit d3b2bc501d
8 changed files with 53 additions and 9 deletions
+6 -2
View File
@@ -397,11 +397,15 @@ send_em(const char* svr, int udp, int usessl, int noanswer, int onarrival,
/** SIGPIPE handler */
static RETSIGTYPE sigh(int sig)
{
char str[] = "Got unhandled signal \n";
if(sig == SIGPIPE) {
printf("got SIGPIPE, remote connection gone\n");
char* strpipe = "got SIGPIPE, remote connection gone\n";
write(STDOUT_FILENO, strpipe, strlen(strpipe));
exit(1);
}
printf("Got unhandled signal %d\n", sig);
str[21] = '0' + (sig/10)%10;
str[22] = '0' + sig%10;
write(STDOUT_FILENO, str, strlen(str));
exit(1);
}
#endif /* SIGPIPE */