From 65b78ea3013c3e1a5fd70e4dee6e08996cdcaa62 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Thu, 17 Nov 2016 01:08:49 +0530 Subject: [PATCH] use `giterr_set_str()` wherever possible `giterr_set()` is used when it is required to format a string, and since we don't really require it for this case, it is better to stick to `giterr_set_str()`. This also suppresses a warning(-Wformat-security) raised by the compiler. Signed-off-by: Pranit Bauva --- src/index.c | 2 +- src/zstream.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.c b/src/index.c index bc15959a8..42579f19a 100644 --- a/src/index.c +++ b/src/index.c @@ -552,7 +552,7 @@ int git_index_clear(git_index *index) static int create_index_error(int error, const char *msg) { - giterr_set(GITERR_INDEX, msg); + giterr_set_str(GITERR_INDEX, msg); return error; } diff --git a/src/zstream.c b/src/zstream.c index d9ad4ca89..d949aa81a 100644 --- a/src/zstream.c +++ b/src/zstream.c @@ -21,7 +21,7 @@ static int zstream_seterr(git_zstream *zs) if (zs->zerr == Z_MEM_ERROR) giterr_set_oom(); else if (zs->z.msg) - giterr_set(GITERR_ZLIB, zs->z.msg); + giterr_set_str(GITERR_ZLIB, zs->z.msg); else giterr_set(GITERR_ZLIB, "Unknown compression error");