freebsd-ports/net/wmping/files/patch-wmping.c
Robert Clausecker 14df860062 net/wmping: fix the port's build against -fno-common
Ensure that there is only one variable definition per each object, as
the C (and C++) standards mandated for years and compilers started to
enforce as of recently (Clang 11, GCC 10).

While here, define LICENSE, add missing USE_XORG components, and fix
-Wformat-security warnings, adding newline to printed error messages
for clarity and better look.

PR:	267587
2022-11-07 08:01:32 +00:00

38 lines
1.2 KiB
C

--- wmping.c.orig 2004-02-09 09:27:38 UTC
+++ wmping.c
@@ -237,7 +237,7 @@ void readconf()
if(strcmp(tokens[1],"="))
{
sprintf(str_err, "Not correct format of configuration file ( %s ): line %u", cfgfile, lineN);
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
exit(-1);
}
@@ -288,7 +288,7 @@ void readconf()
else
{
sprintf(str_err, "Not correct format of configuration file ( %s ): line %u", cfgfile, lineN);
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
exit(-1);
}
@@ -297,7 +297,7 @@ void readconf()
else
{
sprintf(str_err, "Error open configuration file ( %s ): %s", cfgfile, strerror(errno));
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
fprintf(stderr, "\n Create default configuration file\n");
createDefaultCfg(cfgfile);
}
@@ -305,7 +305,7 @@ void readconf()
else
{
sprintf(str_err, "Error open configuration file ( %s ): %s", cfgfile, strerror(errno));
- fprintf(stderr, str_err);
+ fprintf(stderr, "%s\n", str_err);
fprintf(stderr, "\n Create default configuration file\n");
createDefaultCfg(cfgfile);
}