diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-05-13 10:07:52 +0000 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-05-13 10:07:52 +0000 |
commit | c334bcf1862a48ebb37e80aca319d4aa5baad061 (patch) | |
tree | 227c6be05a7d77120859ebd766e8fea1468407d9 /util.c | |
parent | c3b5da658eeef51b1444060aa107fc413ea0f436 (diff) |
cleanup, tested with tcc
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -43,7 +43,8 @@ printlink(const char *link, const char *baseurl, FILE *fp) { int isrelative; /* protocol part */ - for(p = link; *p && (isalpha((int)*p) || isdigit((int)*p) || *p == '+' || *p == '-' || *p == '.'); p++); + for(p = link; *p && (isalpha((int)*p) || isdigit((int)*p) || + *p == '+' || *p == '-' || *p == '.'); p++); /* relative link (baseurl is used). */ isrelative = strncmp(p, "://", strlen("://")); if(isrelative) { @@ -82,7 +83,7 @@ parseline(char **line, size_t *size, char **fields, unsigned int i = 0; char *prev, *s; - if(afgets(line, size, fp)) { + if(getline(line, size, fp) > 0) { for(prev = *line; (s = strchr(prev, separator)) && i <= maxfields; i++) { *s = '\0'; fields[i] = prev; @@ -95,7 +96,8 @@ parseline(char **line, size_t *size, char **fields, return i; } -/* print feed name for id; spaces and tabs in string as "-" (spaces in anchors are not valid). */ +/* print feed name for id; spaces and tabs in string as "-" + * (spaces in anchors are not valid). */ void printfeednameid(const char *s, FILE *fp) { for(; *s; s++) |