fix compilation under Linux - ploot - simple plotting tools | |
git clone git://bitreich.org/ploot git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit fe139dc6e7dddb2211caedff45f9ba2a0ec47723 | |
parent f24b386089412df1f2d658ecefd3471f3bddfda3 | |
Author: Josuah Demangeon <[email protected]> | |
Date: Wed, 7 Feb 2018 00:47:33 +0100 | |
fix compilation under Linux | |
Diffstat: | |
M Makefile | 2 +- | |
M ploot.c | 4 ++-- | |
2 files changed, 3 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/Makefile b/Makefile | |
@@ -1,4 +1,4 @@ | |
-CFLAGS = -Wall -Wextra -Werror -std=c89 -pedantic | |
+CFLAGS = -Wall -Wextra -Werror -std=c89 -pedantic -D_POSIX_C_SOURCE=200… | |
all:ploot | |
diff --git a/ploot.c b/ploot.c | |
@@ -56,7 +56,7 @@ humanize(char *str, double val) | |
precision = (ABS(val) < 10) ? (3) : (ABS(val) < 100) ? (2) : (1); | |
if (exp == 0) | |
precision++; | |
- snprintf(str, 8, "%+.*f%c", precision, val, label[exp]); | |
+ sprintf(str, "%+.*f%c", precision, val, label[exp]); | |
if (val >= 0) | |
str[0] = ' '; | |
} | |
@@ -254,7 +254,7 @@ main(int argc, char **argv) | |
{ | |
time_t tbuf[MAX_VAL], *tend; | |
double vbuf[MAX_VAL], *vend; | |
- char c; | |
+ int c; | |
while ((c = getopt(argc, argv, "h:t:o:")) != -1) { | |
switch (c) { |