[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [OpenOCD-devel] [PATCH]: 72532d0 flash/nor/nrf5: fix regression, compile error on cygwin/newlib
From:       gerrit () openocd ! org (gerrit)
Date:       2020-03-26 22:44:44
Message-ID: 20200326224444.D61A14A1B8F () mail ! openocd ! org
[Download RAW message or body]

This is an automated email from Gerrit.

Tomas Vanek (vanekt@fbl.cz) just uploaded a new patch set to Gerrit, which you can \
find at http://openocd.zylin.com/5546

-- gerrit

commit 72532d0f1149f842cf389e033579d3b91461575f
Author: Tomas Vanek <vanekt@fbl.cz>
Date:   Thu Mar 26 23:32:26 2020 +0100

    flash/nor/nrf5: fix regression, compile error on cygwin/newlib
    
    The code introduced in 5da746fa09dc1fbc28b4b4431035f5058a7e76a2
    used isalnum() function on a signed char argument.
    Fix it by explicit cast of buffer pointer.
    
    Change-Id: Ifa216cb081aafa1a2cb1a9e6b5392afdb77a3052
    Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
    Reported-by: Åke Rehnman <ake.rehnman@gmail.com>

diff --git a/src/flash/nor/nrf5.c b/src/flash/nor/nrf5.c
index 8422589..7b0ed2e 100644
--- a/src/flash/nor/nrf5.c
+++ b/src/flash/nor/nrf5.c
@@ -570,9 +570,10 @@ static int nrf5_protect(struct flash_bank *bank, int set, int \
first, int last)  
 static bool nrf5_info_variant_to_str(uint32_t variant, char *bf)
 {
-	h_u32_to_be((uint8_t *)bf, variant);
+	uint8_t *ubf = (uint8_t *)bf;
+	h_u32_to_be(ubf, variant);
 	bf[4] = '\0';
-	if (isalnum(bf[0]) && isalnum(bf[1]) && isalnum(bf[2]) && isalnum(bf[3]))
+	if (isalnum(ubf[0]) && isalnum(ubf[1]) && isalnum(ubf[2]) && isalnum(ubf[3]))
 		return true;
 
 	strcpy(bf, "xxxx");

-- 


_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic