Change in libosmocore[master]: fix isdigit taking unsigned as input

2021-11-19 Thread Hoernchen
Hoernchen has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/26329 )

Change subject: fix isdigit taking unsigned as input
..

fix isdigit taking unsigned as input

gcc complains because our char might or might not be signed depending on
arch and phase of the moon:
error: array subscript has type 'char' [-Werror=charsubscripts]

Change-Id: I7c76f9a2318c4f0e5eedeea00ec380824b86567e
---
M src/utils.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Hoernchen: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/utils.c b/src/utils.c
index 626dcb4..300204a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1250,7 +1250,7 @@
if (point)
return -EINVAL;
point = p;
-   } else if (!isdigit(*p))
+   } else if (!isdigit((unsigned char)*p))
return -EINVAL;
}


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26329
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I7c76f9a2318c4f0e5eedeea00ec380824b86567e
Gerrit-Change-Number: 26329
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: merged


Change in libosmocore[master]: fix isdigit taking unsigned as input

2021-11-19 Thread Hoernchen
Hoernchen has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/26329 )

Change subject: fix isdigit taking unsigned as input
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26329
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I7c76f9a2318c4f0e5eedeea00ec380824b86567e
Gerrit-Change-Number: 26329
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen 
Gerrit-Reviewer: Hoernchen 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 19 Nov 2021 12:03:07 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: fix isdigit taking unsigned as input

2021-11-19 Thread Hoernchen
Hoernchen has uploaded a new patch set (#2). ( 
https://gerrit.osmocom.org/c/libosmocore/+/26329 )

Change subject: fix isdigit taking unsigned as input
..

fix isdigit taking unsigned as input

gcc complains because our char might or might not be signed depending on
arch and phase of the moon:
error: array subscript has type 'char' [-Werror=charsubscripts]

Change-Id: I7c76f9a2318c4f0e5eedeea00ec380824b86567e
---
M src/utils.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/26329/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26329
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I7c76f9a2318c4f0e5eedeea00ec380824b86567e
Gerrit-Change-Number: 26329
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen 
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: fix isdigit taking unsigned as input

2021-11-19 Thread Hoernchen
Hoernchen has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/26329 )


Change subject: fix isdigit taking unsigned as input
..

fix isdigit taking unsigned as input

gcc complains because our char might or might not be signed depending on
arch and phase of the moon:

Change-Id: I7c76f9a2318c4f0e5eedeea00ec380824b86567e
error: array subscript has type 'char' [-Werror=charsubscripts]
---
M src/utils.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/26329/1

diff --git a/src/utils.c b/src/utils.c
index 626dcb4..300204a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1250,7 +1250,7 @@
if (point)
return -EINVAL;
point = p;
-   } else if (!isdigit(*p))
+   } else if (!isdigit((unsigned char)*p))
return -EINVAL;
}


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26329
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I7c76f9a2318c4f0e5eedeea00ec380824b86567e
Gerrit-Change-Number: 26329
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen 
Gerrit-MessageType: newchange


Change in ...libosmocore[master]: fix isdigit taking unsigned as input

2019-06-13 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/14149 )

Change subject: fix isdigit taking unsigned as input
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14149
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia13fd5ee79fc6dc3291c0b99958ab3c01afee17d
Gerrit-Change-Number: 14149
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 13 Jun 2019 13:49:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...libosmocore[master]: fix isdigit taking unsigned as input

2019-06-13 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/libosmocore/+/14149 )

Change subject: fix isdigit taking unsigned as input
..

fix isdigit taking unsigned as input

fixes the following error warnings when cross-compiling using:
./configure --enable-static --prefix=/usr/local/arm-none-eabi 
--host=arm-none-eabi --enable-embedded --disable-doxygen --disable-shared 
--disable-pseudotalloc --enable-external-tests CFLAGS="-Os -ffunction-sections 
-fdata-sections -nostartfiles -nodefaultlibs -Werror -Wno-error=deprecated 
-Wno-error=deprecated-declarations -Wno-error=cpp -mthumb -Os -mlong-calls -g3 
-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Wno-error=format"

utils.c:1002:18: error: array subscript has type 'char' 
[-Werror=char-subscripts]
 1002 |   if (!isdigit(in[i]))

gsm23003.c:414:34: error: array subscript has type 'char' 
[-Werror=char-subscripts]
  414 |  if (!mnc_str || !isdigit(mnc_str[0]) || strlen(mnc_str) > 3)

Change-Id: Ia13fd5ee79fc6dc3291c0b99958ab3c01afee17d
---
M src/gsm/gsm23003.c
M src/utils.c
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 4cc2671..e20afcb 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -411,7 +411,7 @@
char *endptr;
int rc = 0;

-   if (!mnc_str || !isdigit(mnc_str[0]) || strlen(mnc_str) > 3)
+   if (!mnc_str || !isdigit((unsigned char)mnc_str[0]) || strlen(mnc_str) 
> 3)
return -EINVAL;

errno = 0;
diff --git a/src/utils.c b/src/utils.c
index 7b7178c..7364bfb 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -999,7 +999,7 @@

/* All input must be numbers */
for (i = 0; i < in_len; i++) {
-   if (!isdigit(in[i]))
+   if (!isdigit((unsigned char)in[i]))
return -EINVAL;
}


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14149
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia13fd5ee79fc6dc3291c0b99958ab3c01afee17d
Gerrit-Change-Number: 14149
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in libosmocore[master]: fix isdigit taking unsigned as input

2019-05-29 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/14149 )

Change subject: fix isdigit taking unsigned as input
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/14149
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia13fd5ee79fc6dc3291c0b99958ab3c01afee17d
Gerrit-Change-Number: 14149
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Wed, 29 May 2019 14:17:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: fix isdigit taking unsigned as input

2019-05-23 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/14149


Change subject: fix isdigit taking unsigned as input
..

fix isdigit taking unsigned as input

fixes the following error warnings when cross-compiling using:
./configure --enable-static --prefix=/usr/local/arm-none-eabi 
--host=arm-none-eabi --enable-embedded --disable-doxygen --disable-shared 
--disable-pseudotalloc --enable-external-tests CFLAGS="-Os -ffunction-sections 
-fdata-sections -nostartfiles -nodefaultlibs -Werror -Wno-error=deprecated 
-Wno-error=deprecated-declarations -Wno-error=cpp -mthumb -Os -mlong-calls -g3 
-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Wno-error=format"

utils.c:1002:18: error: array subscript has type 'char' 
[-Werror=char-subscripts]
 1002 |   if (!isdigit(in[i]))

gsm23003.c:414:34: error: array subscript has type 'char' 
[-Werror=char-subscripts]
  414 |  if (!mnc_str || !isdigit(mnc_str[0]) || strlen(mnc_str) > 3)

Change-Id: Ia13fd5ee79fc6dc3291c0b99958ab3c01afee17d
---
M src/gsm/gsm23003.c
M src/utils.c
2 files changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/14149/1

diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index a97ed07..584654b 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -411,7 +411,7 @@
char *endptr;
int rc = 0;

-   if (!mnc_str || !isdigit(mnc_str[0]) || strlen(mnc_str) > 3)
+   if (!mnc_str || !isdigit((unsigned char)mnc_str[0]) || strlen(mnc_str) 
> 3)
return -EINVAL;

errno = 0;
diff --git a/src/utils.c b/src/utils.c
index 59dc816..6b871c8 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -999,7 +999,7 @@
 
/* All input must be numbers */
for (i = 0; i < in_len; i++) {
-   if (!isdigit(in[i]))
+   if (!isdigit((unsigned char)in[i]))
return -EINVAL;
}


--
To view, visit https://gerrit.osmocom.org/14149
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia13fd5ee79fc6dc3291c0b99958ab3c01afee17d
Gerrit-Change-Number: 14149
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon