1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-12 04:15:06 -05:00

better use ERR than fprintf for error messages

This commit is contained in:
Aurelien Foret 2006-02-14 18:30:23 +00:00
parent a56e13d770
commit 07e46d2fc0

View File

@ -38,6 +38,7 @@
#include "util.h" #include "util.h"
#include "list.h" #include "list.h"
#include "conf.h" #include "conf.h"
#include "log.h"
extern int maxcols; extern int maxcols;
extern config_t *config; extern config_t *config;
@ -195,7 +196,7 @@ int reg_match(char *string, char *pattern)
regex_t reg; regex_t reg;
if(regcomp(&reg, pattern, REG_EXTENDED | REG_NOSUB | REG_ICASE) != 0) { if(regcomp(&reg, pattern, REG_EXTENDED | REG_NOSUB | REG_ICASE) != 0) {
fprintf(stderr, "error: %s is not a valid regular expression.\n", pattern); ERR(NL, "%s is not a valid regular expression.\n", pattern);
return(-1); return(-1);
} }
result = regexec(&reg, string, 0, 0, 0); result = regexec(&reg, string, 0, 0, 0);