Skip to content

Commit 42594f3

Browse files
committed
signature: use GIT_ASSERT
1 parent ef6b12b commit 42594f3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/signature.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema
6565
{
6666
git_signature *p = NULL;
6767

68-
assert(name && email);
68+
GIT_ASSERT_ARG(name);
69+
GIT_ASSERT_ARG(email);
6970

7071
*sig_out = NULL;
7172

@@ -279,7 +280,8 @@ int git_signature_from_buffer(git_signature **out, const char *buf)
279280
const char *buf_end;
280281
int error;
281282

282-
assert(out && buf);
283+
GIT_ASSERT_ARG(out);
284+
GIT_ASSERT_ARG(buf);
283285

284286
*out = NULL;
285287

@@ -302,7 +304,8 @@ void git_signature__writebuf(git_buf *buf, const char *header, const git_signatu
302304
int offset, hours, mins;
303305
char sign;
304306

305-
assert(buf && sig);
307+
GIT_ASSERT_ARG(buf);
308+
GIT_ASSERT_ARG(sig);
306309

307310
offset = sig->when.offset;
308311
sign = (sig->when.offset < 0 || sig->when.sign == '-') ? '-' : '+';
@@ -320,7 +323,8 @@ void git_signature__writebuf(git_buf *buf, const char *header, const git_signatu
320323

321324
bool git_signature__equal(const git_signature *one, const git_signature *two)
322325
{
323-
assert(one && two);
326+
GIT_ASSERT_ARG(one);
327+
GIT_ASSERT_ARG(two);
324328

325329
return
326330
git__strcmp(one->name, two->name) == 0 &&

0 commit comments

Comments
 (0)