Summary:ASTERISK-04343: [patch] Small data types falsify results
Reporter:Konstantinos Arvanitis (karvanitis)Labels:
Date Opened:2005-06-04 03:11:52Date Closed:2008-01-15 15:38:09.000-0600
Versions:Frequency of
Environment:Attachments:( 0) char2int.patch
Description:Functions 'ast_waitstream', 'ast_waitfordigit_full' and 'ast_waitfordigit'  return a 'char' instead of an 'int', so some tests fail if asterisk is not compiled with -fsigned-char in machines where char is unsigned by default.

This results in endless loops in some places.


I have attached a patch to replace the return type with 'int' and fix all places where the results where stored in a 'char' variable with implicit 'signed char' assumption.

Now all results from the above functions are stored in 'int' variables, thus eliminating the problem.

The patch is trivial and thus I disclaim all copyright from it. (Can I do that?)
Comments:By: Kevin P. Fleming (kpfleming) 2005-06-05 11:04:06

Yes, this is simple enough to accept without a disclaimer. I've committed these changes to CVS HEAD, but I'll have to let Russell get them into the v1-0 branch.

By: Russell Bryant (russell) 2005-06-14 14:41:49

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:37:12.000-0600

Repository: asterisk
Revision: 5846

U   trunk/app.c
U   trunk/channel.c
U   trunk/file.c
U   trunk/include/asterisk/channel.h
U   trunk/include/asterisk/file.h
U   trunk/pbx.c

r5846 | kpfleming | 2008-01-15 15:37:12 -0600 (Tue, 15 Jan 2008) | 2 lines

make ast_waitstream_* return value compatible with platforms that use unsigned char by default (bug ASTERISK-4343)



By: Digium Subversion (svnbot) 2008-01-15 15:38:09.000-0600

Repository: asterisk
Revision: 5908

U   branches/v1-0/app.c
U   branches/v1-0/channel.c
U   branches/v1-0/file.c
U   branches/v1-0/include/asterisk/channel.h
U   branches/v1-0/include/asterisk/file.h
U   branches/v1-0/pbx.c

r5908 | russell | 2008-01-15 15:38:09 -0600 (Tue, 15 Jan 2008) | 2 lines

fix return values on systems where an unsigned char is the default (bug ASTERISK-4343)