linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Re: use proper printf rather than ugly cast in cor


From: Mike Frysinger
Subject: [Linphone-developers] Re: use proper printf rather than ugly cast in coreapi/linphonecore.c
Date: Wed, 2 Jan 2008 14:27:57 -0500

On Jan 2, 2008 1:40 PM, Mike Frysinger <address@hidden> wrote:
> it looks like in order to get rid of a warning, someone did:
> snprintf(clen,sizeof(clen),"%u",(unsigned int)strlen(dtmf_body));
> that's just silly ... strlen returns a size_t, not an unsigned int.
> so just use a proper printf format string and everything is fine:
> snprintf(clen,sizeof(clen),"%zi",strlen(dtmf_body));

i just flipped through the archives and it seems the cast was picked
over proper printf for portability reasons.  the cast should be
changed to unsigned long then and the printf changed to %lu.:
snprintf(clen,sizeof(clen),"%lu",(unsigned long)strlen(dtmf_body));
-mike




reply via email to

[Prev in Thread] Current Thread [Next in Thread]