[PATCH] ussd: Fix test for RELEASE COMPLETE

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Tue Oct 8 10:49:56 UTC 2013


On Tue, Oct 08, 2013 at 11:59:09AM +0200, Alexander Huemer wrote:

Dear Alexander,

> Well, as I see it the test against 0xFF is not true under any 
> circumstances, as long as the code is not intentionally compiled with 
> -funsigned-char. If there is an undesired behavior change because of 
> this code change, it's a bug. What's your opinion?

well, I agree that it is not nice and we can/should change it to a
plain null termination. What I doubt that it is currently a problem
or can you present a smoking gun?




int main(int argc, char **argv)
{
	signed char a = 0xFF;
	signed char b = 0xFF;

	if (a == b)
		printf("THE SAME\n");
	return 0;
}


PS: some ABIs.. e.g. ARM ones.. char will be unsigned.




More information about the OpenBSC mailing list