aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
AgeCommit message (Collapse)Author
2016-10-23Simplify hex color parserDmitrij D. Czarkoff
It is actually a trivial task for strtoul + some bit shifting, so there is no need for two separate functions.
2016-10-09Be more correct in read_from_stdin()Dmitrij D. Czarkoff
From read(2) manual page on OpenBSD: Error checks should explicitly test for -1. Code such as while ((nr = read(fd, buf, sizeof(buf))) > 0) is not maximally portable, as some platforms allow for nbytes to range between SSIZE_MAX and SIZE_MAX - 2, in which case the return value of an error-free read() may appear as a negative number distinct from -1. Proper loops should use while ((nr = read(fd, buf, sizeof(buf))) != -1 && nr != 0) Distingushing between error and eof would also help for debugging.
2016-09-27Fix minor memory leak in load_font()Harry Jeffery
2016-04-26Add vim modelinesDmitrij D. Czarkoff
2016-01-14Loading image data from standard inputDmitrij D. Czarkoff
This commit changes processing of arguments: * When called without arguments (with or without flags), imv reads list of files from standard input. * When called with "-" among arguments, read image data from standard input.
2015-12-28Remove names from file copyright headersHarry Jeffery
2015-12-10Move text rendering into a util functionHarry Jeffery
2015-11-28Move utility functions from main.c to util.cHarry Jeffery