Introduction
Introduction Statistics Contact Development Disclaimer Help
some code simplifications - smu - smu - simple markup (Markdown) processor (for…
git clone git://git.codemadness.org/smu
Log
Files
Refs
README
LICENSE
---
commit fbc3d2b11f52754309998077a50a757278671759
parent 2b8ceea120b0fb3679e919420bae4c7cbcb7e654
Author: Hiltjo Posthuma <[email protected]>
Date: Tue, 11 May 2021 02:29:44 +0200
some code simplifications
Diffstat:
M smu.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/smu.c b/smu.c
@@ -701,30 +701,27 @@ main(int argc, char *argv[])
char *buffer = NULL;
int s, i;
unsigned long len, bsize;
- FILE *source = stdin;
if (pledge("stdio", NULL) == -1)
eprint("pledge");
for (i = 1; i < argc; i++) {
if (!strcmp("-v", argv[i]))
- eprint("simple markup %s\n",VERSION);
+ eprint("smu v%s\n", VERSION);
else if (!strcmp("-n", argv[i]))
nohtml = 1;
- else if (argv[i][0] != '-' || !strcmp("-h", argv[i]))
- usage(argv);
else
usage(argv);
}
bsize = 2 * BUFSIZ;
buffer = ereallocz(buffer, bsize);
len = 0;
- while ((s = fread(buffer + len, 1, BUFSIZ, source))) {
+ while ((s = fread(buffer + len, 1, BUFSIZ, stdin))) {
len += s;
if (BUFSIZ + len + 1 > bsize) {
bsize += BUFSIZ;
if (!(buffer = realloc(buffer, bsize)))
- eprint("realloc failed.");
+ eprint("realloc");
}
}
buffer[len] = '\0';
You are viewing proxied material from codemadness.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.