Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 65b78ea

Browse files
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 <[email protected]>
1 parent a6763ff commit 65b78ea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ int git_index_clear(git_index *index)
552552

553553
static int create_index_error(int error, const char *msg)
554554
{
555-
giterr_set(GITERR_INDEX, msg);
555+
giterr_set_str(GITERR_INDEX, msg);
556556
return error;
557557
}
558558

src/zstream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int zstream_seterr(git_zstream *zs)
2121
if (zs->zerr == Z_MEM_ERROR)
2222
giterr_set_oom();
2323
else if (zs->z.msg)
24-
giterr_set(GITERR_ZLIB, zs->z.msg);
24+
giterr_set_str(GITERR_ZLIB, zs->z.msg);
2525
else
2626
giterr_set(GITERR_ZLIB, "Unknown compression error");
2727

0 commit comments

Comments
 (0)