[evolution-data-server] EBookSqlite: Address runtime warnings from remove_leading_zeros() in unit tests
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] EBookSqlite: Address runtime warnings from remove_leading_zeros() in unit tests
- Date: Tue, 21 Jan 2020 18:09:05 +0000 (UTC)
commit 592127c0e7631419e869f5bc28134f0e37b2bdfb
Author: Milan Crha <mcrha redhat com>
Date: Tue Jan 21 18:55:50 2020 +0100
EBookSqlite: Address runtime warnings from remove_leading_zeros() in unit tests
src/addressbook/libedata-book/e-book-sqlite.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/addressbook/libedata-book/e-book-sqlite.c b/src/addressbook/libedata-book/e-book-sqlite.c
index 79ca346d6..82817ded5 100644
--- a/src/addressbook/libedata-book/e-book-sqlite.c
+++ b/src/addressbook/libedata-book/e-book-sqlite.c
@@ -3175,10 +3175,15 @@ remove_leading_zeros (gchar *number)
gchar *trimmed = NULL;
gchar *tmp = number;
- g_return_val_if_fail (NULL != number, NULL);
+ if (!number)
+ return NULL;
while ('0' == *tmp)
tmp++;
+
+ if (tmp == number)
+ return number;
+
trimmed = g_strdup (tmp);
g_free (number);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]