Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] result_normal_plus[2]='\0' likely clobbers payload (was Re: issues with format of double (or IEEE754))
- Date: Wed, 26 Jul 2006 13:26:58 -0400
- From: Jim <jep200404@example.com>
- Subject: [tlug] result_normal_plus[2]='\0' likely clobbers payload (was Re: issues with format of double (or IEEE754))
- References: <20060726125907.GH5111@example.com> <87ejw8corz.fsf@example.com>
"Stephen J. Turnbull" wrote: > Have you tried > > result_normal_plus[2] = '\0'; > printf ("header = '%s'\n", result_normal_plus); Unless a backup copy of result_normal_plus[2] is made first, result_normal_plus[2]='\0'; is likely to clobber the binary data payload. It'd be better to deal with the two ASCII character as just two ASCII characters (that are not in a string), printf("header = '%c%c'\n", result_normal_plus[0],result_normal_plus[1]) or to _copy_ them into a nul-terminated string. header[0]=result_normal_plus[0]; header[1]=result_normal_plus[1]; header[2]='\0'; printf("header = '%s'\n", header);
- Follow-Ups:
- Re: [tlug] result_normal_plus[2]='\0' likely clobbers payload
- From: Stephen J. Turnbull
- References:
- [tlug] issues with format of double (or IEEE754)
- From: Michal Hajek
- Re: [tlug] issues with format of double (or IEEE754)
- From: Stephen J. Turnbull
Home | Main Index | Thread Index
- Prev by Date: [tlug] What does 80387 have to do with IEEE 754 issues? It's moot. (was Re: issues with format of double (or IEEE754))
- Next by Date: Re: [tlug] What does 80387 have to do with IEEE 754 issues? It's moot. (was Re: issues with format of double (or IEEE754))
- Previous by thread: Re: [tlug] issues with format of double (or IEEE754)
- Next by thread: Re: [tlug] result_normal_plus[2]='\0' likely clobbers payload
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links