[glib: 3/6] gbase64: Fix an impossible condition
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/6] gbase64: Fix an impossible condition
- Date: Wed, 27 Feb 2019 11:42:34 +0000 (UTC)
commit f9dfddf8eb4952fc5e0a77fffeff70c7cea37b68
Author: Philip Withnall <withnall endlessm com>
Date: Wed Feb 27 10:27:43 2019 +0000
gbase64: Fix an impossible condition
len is unsigned, so it’s not possible for it to be less than zero.
Signed-off-by: Philip Withnall <withnall endlessm com>
glib/gbase64.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gbase64.c b/glib/gbase64.c
index baddae098..ef6a39832 100644
--- a/glib/gbase64.c
+++ b/glib/gbase64.c
@@ -105,7 +105,7 @@ g_base64_encode_step (const guchar *in,
g_return_val_if_fail (state != NULL, 0);
g_return_val_if_fail (save != NULL, 0);
- if (len <= 0)
+ if (len == 0)
return 0;
inptr = in;
@@ -339,7 +339,7 @@ g_base64_decode_step (const gchar *in,
g_return_val_if_fail (state != NULL, 0);
g_return_val_if_fail (save != NULL, 0);
- if (len <= 0)
+ if (len == 0)
return 0;
inend = (const guchar *)in+len;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]