Re: [hackers] [sent] Support farbfeld as an intermediate format || sin

From: Dimitris Papastamos <sin_AT_2f30.org>
Date: Tue, 8 Dec 2015 21:23:40 +0000

> +Image *ffopen(char *filename)
> {
> - FILE *f;
> - unsigned char buf[8];
> + unsigned char hdr[16];
> + char *bin;
> + regex_t regex;
> Image *img;
> + size_t i;
> + int tmpfd, fd;
> +
> + for (bin = NULL, i = 0; i < LEN(filters); i++) {
> + if (regcomp(&regex, filters[i].regex,
> + REG_NOSUB | REG_EXTENDED | REG_ICASE))
> + continue;
> + if (!regexec(&regex, filename, 0, NULL, 0)) {
> + bin = filters[i].bin;
> + break;
> + }
> + }

I forgot an if (!bin) return NULL sort of thing here.
Received on Tue Dec 08 2015 - 22:23:40 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 08 2015 - 22:24:13 CET