Introduction
Introduction Statistics Contact Development Disclaimer Help
add pledge support everywhere - ics2txt - convert icalendar .ics file to plain …
git clone git://bitreich.org/ics2txt git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws…
Log
Files
Refs
Tags
README
---
commit 506b1d5a4c1c6cdd5ad6218b3251853cf21cce37
parent e485da8103dbe29bd2376a5f3e095581ce0bc50e
Author: Josuah Demangeon <[email protected]>
Date: Sun, 20 Jun 2021 22:00:26 +0200
add pledge support everywhere
Diffstat:
M Makefile | 2 +-
M ics2tree.c | 3 +++
M strtonum.c | 1 -
M tsv2agenda.c | 6 +++---
4 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/Makefile b/Makefile
@@ -7,7 +7,7 @@ CFLAGS = $D $W -g
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/man
-SRC = ical.c base64.c util.c
+SRC = ical.c base64.c util.c strtonum.c
HDR = ical.h base64.h util.h
OBJ = ${SRC:.c=.o}
AWK = tsv2ics.awk
diff --git a/ics2tree.c b/ics2tree.c
@@ -72,6 +72,9 @@ main(int argc, char **argv)
IcalParser p = {0};
arg0 = *argv++;
+ if (pledge("stdio") < 0)
+ err(1, "pledge: %s", strerror(errno));
+
p.fn_field_name = fn_field_name;
p.fn_block_begin = fn_block_begin;
p.fn_param_value = fn_param_value;
diff --git a/strtonum.c b/strtonum.c
@@ -63,4 +63,3 @@ strtonum(const char *numstr, long long minval, long long maxv…
return (ll);
}
-DEF_WEAK(strtonum);
diff --git a/tsv2agenda.c b/tsv2agenda.c
@@ -227,6 +227,9 @@ main(int argc, char **argv)
if ((flag_from = time(NULL)) == (time_t)-1)
err(1, "time: %s", strerror(errno));
+ if (pledge("stdio", "") < 0)
+ err(1, "pledge: %s", strerror(errno));
+
arg0 = *argv;
while ((c = getopt(argc, argv, "f:t:")) > 0) {
char const *e;
@@ -249,9 +252,6 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
- if (pledge("stdio", "") < 0)
- err(1, "pledge: %s", strerror(errno));
-
tsv_to_agenda(&ctx, stdin);
return 0;
}
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.