Skip to content

Commit a0c0c2e

Browse files
committed
Merge branch 'jn/clean-use-error-not-fprintf-on-stderr'
Some error messages in "git config" were emitted without calling the usual error() facility. * jn/clean-use-error-not-fprintf-on-stderr: config: use error() instead of fprintf(stderr, ...)
2 parents 5fa9e4c + 95d6212 commit a0c0c2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int get_value(const char *key_, const char *regex_)
193193

194194
key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
195195
if (regcomp(key_regexp, key, REG_EXTENDED)) {
196-
fprintf(stderr, "Invalid key pattern: %s\n", key_);
196+
error("invalid key pattern: %s", key_);
197197
free(key_regexp);
198198
key_regexp = NULL;
199199
ret = CONFIG_INVALID_PATTERN;
@@ -214,7 +214,7 @@ static int get_value(const char *key_, const char *regex_)
214214

215215
regexp = (regex_t*)xmalloc(sizeof(regex_t));
216216
if (regcomp(regexp, regex_, REG_EXTENDED)) {
217-
fprintf(stderr, "Invalid pattern: %s\n", regex_);
217+
error("invalid pattern: %s", regex_);
218218
free(regexp);
219219
regexp = NULL;
220220
ret = CONFIG_INVALID_PATTERN;

0 commit comments

Comments
 (0)