Age | Commit message (Collapse) | Author | |
---|---|---|---|
2020-01-24 | cleanup some includes | Hiltjo Posthuma | |
2019-04-25 | util: small code-style fix | Hiltjo Posthuma | |
2019-04-21 | util: keep brackets when parsing IPv6 addresses | Hiltjo Posthuma | |
2019-04-15 | util: remove unneeded err.h header | Hiltjo Posthuma | |
2019-04-06 | util: remove unnecesary cast and initialization | Hiltjo Posthuma | |
2019-03-08 | util: pedantic snprintf improvement | Hiltjo Posthuma | |
POSIX says about snprintf: "If an output error was encountered, these functions shall return a negative value". So check for < 0 instead of -1. Afaik all implementations return -1 though. | |||
2019-02-27 | util: parseuri: fix typo in cast (ssize_t) | Hiltjo Posthuma | |
2018-09-07 | util.c: remove remaining uint8_t type, we assume a sane CHAR_BIT == 8 | Hiltjo Posthuma | |
2018-09-07 | fix many undefined behaviour in usage of ctype functions | Hiltjo Posthuma | |
- cast all ctype(3) function argument to (unsigned char) to avoid UB POSIX says: "The c argument is an int, the value of which the application shall ensure is a character representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined." Many libc cast implicitly the value, but NetBSD does not, which is probably the correct thing to interpret it. - no need to cast for putchar + rename some fputc(..., stdout) to putchar POSIX says: "The fputc() function shall write the byte specified by c (converted to an unsigned char) to the output stream pointed to by stream [...]" Major thanks to Leonardo Taccari <iamleot@gmail.com> for reporting and testing it on NetBSD! | |||
2018-06-24 | util: printutf8pad: proper counting of multiwidth characters | Hiltjo Posthuma | |
for example the string "\xef\xbc\xb5". | |||
2018-02-18 | util: improve a cast | Hiltjo Posthuma | |
2018-02-16 | util.c: parseuri(): fix incorrect NUL termination for IPv6 addresses | Hiltjo Posthuma | |
2017-12-09 | sfeed_mbox: move murmur to this file, cleanup | Hiltjo Posthuma | |
2017-06-29 | improve printutf8pad for sfeed_plain | Hiltjo Posthuma | |
- use a UTF-8 ellipses (1 column width) for "...". - do proper truncation at the specified length. | |||
2017-04-27 | compatiblity with browsers: use numeric entity for apos | Hiltjo Posthuma | |
this entity is XHTML, it is not supported by some (older) browsers. | |||
2016-08-06 | add USE_PLEDGE, remove pledge dummy function | Hiltjo Posthuma | |
2016-04-10 | absuri, encodeuri: make encodeuri static, change argument order | Hiltjo Posthuma | |
2016-04-10 | util: standard pattern to check for valid number strtoul | Hiltjo Posthuma | |
2016-04-10 | remove basename, just use last part of the path... | Hiltjo Posthuma | |
... as a bonus it also saves an allocation. | |||
2016-04-10 | add comment for strtotime | Hiltjo Posthuma | |
2016-04-10 | strtotime: improve | Hiltjo Posthuma | |
use long long: atleast 32-bit, but now time_t (real) to 32-bit or 64-bit is supported. Long long is C99 though, but that is fine. check errno, it can have ERANGE. | |||
2016-03-10 | remove cast of unused variables | Hiltjo Posthuma | |
2016-02-28 | util: simplify encodehex, use inline | Hiltjo Posthuma | |
2016-02-27 | various improvements | Hiltjo Posthuma | |
- pledge tools and add define to enable it on platforms that support it, currently only OpenBSD 5.9+ - separate getline and parseline functionality. - use murmur3 hash instead of jenkins1: faster and less collisions. - make some error messages a bit more clear, for example with path truncation. - some small cleanups, move printutf8pad to util. | |||
2015-08-22 | util: absuri: simplify + fix port in url with prefix "//" | Hiltjo Posthuma | |
use the port specified in the link for urls starting with "//" (use protocol). | |||
2015-08-22 | util: absuri handle port separately | Hiltjo Posthuma | |
2015-08-22 | util: support ipv6 address, parse port separately | Hiltjo Posthuma | |
2015-08-16 | code-style, wrap some lines, etc | Hiltjo Posthuma | |
2015-08-10 | util: parseuri: nul-terminate, bug introduced by ↵ | Hiltjo Posthuma | |
7f11ef506465896705f15c39bd0416d96ca651a8 | |||
2015-08-08 | util: just zero strings by null-terminating first byte | Hiltjo Posthuma | |
2015-08-07 | util: strtotime: stricter time parsing | Hiltjo Posthuma | |
as input: an empty string or non-digit characters are digits are considered an error now. Still, for the format tools output the formatted time string as time_t 0 on a parse error. | |||
2015-08-02 | util: simplify parseline() and check t for strtotime(). | Hiltjo Posthuma | |
2015-08-02 | refactor print, decodefield into xmlencode | Hiltjo Posthuma | |
... put specific formatting-logic per program (printcontent()). | |||
2015-07-31 | update some comments | Hiltjo Posthuma | |
2015-07-31 | update and improve documentation (WIP) | Hiltjo Posthuma | |
2015-07-31 | Various improvements | Hiltjo Posthuma | |
- Only escape characters in "content" field, these can contain newlines. - Trim newlines and tabs, etc from the title, id and author fields. - Make decodefield, xmlencode functions easier to "chain" without allocatting new buffers. - Move printutf8pad from util (only used by sfeed_plain) to sfeed_plain. - Update README, still need to update the man-page and improve the documentation in general. - Code cleanup. | |||
2015-07-29 | improve includes (dont include headers in .h), fix build on Linux | Hiltjo Posthuma | |
2015-07-28 | improve code-style and consistency | Hiltjo Posthuma | |
2015-07-28 | util, absuri: check truncation of more cases | Hiltjo Posthuma | |
2015-07-28 | util: rewrite uri parser | Hiltjo Posthuma | |
- don't print directly but use an internal buffer (also better for testing). - encode uri when printing (security). - add some comments. | |||
2015-06-21 | improvements | Hiltjo Posthuma | |
2015-06-21 | util: improve printxmlencoded, cleanup | Hiltjo Posthuma | |
2015-06-21 | util: fix parseline crash | Hiltjo Posthuma | |
2015-06-21 | improve printlink, escape characters | Hiltjo Posthuma | |
2015-06-21 | add xbasename for filename to feedname | Hiltjo Posthuma | |
2015-05-24 | sfeed_frames and util cleanup | Hiltjo Posthuma | |
- remove xerr and xerrx, assume the OS closes and flushes file descriptors on OS process exit. - move esnprintf, printcontent to util. | |||
2015-05-16 | util: parseline can return error, unsigned int -> int | Hiltjo Posthuma | |
2015-01-03 | time fixes | Hiltjo Posthuma | |
2015-01-02 | trim string | Hiltjo Posthuma | |
2015-01-02 | Makefile: fix prerequisite rules | Hiltjo Posthuma | |