Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > sscanf up to 127 characters into a buffer?

Reply
Thread Tools

sscanf up to 127 characters into a buffer?

 
 
Shao Miller
Guest
Posts: n/a
 
      03-17-2013
On 3/17/2013 13:20, Bart van Ingen Schenau wrote:
> On Fri, 15 Mar 2013 13:01:19 +0000, Ike Naar wrote:
>
>> On 2013-03-15, Bart van Ingen Schenau <(E-Mail Removed)>
>> wrote:
>>> On Fri, 15 Mar 2013 03:33:02 -0400, Shao Miller wrote:
>>>> #define Stringify_(x) # x
>>>> #define Stringify(x) Stringify_(x)
>>> #define CvMaxStringLength 127
>>>> #define CvBufSize 128
>>> #define CbBufSize CvMaxStringLength+1

>>
>> This definition may lead to an unpleasant surprise when it is used in an
>> expression such as
>>
>> CbBufSize * 2
>>
>> A safer definition would be
>>
>> #define CbBufSize (CvMaxStringLength+1)

>
> Oops.
> What was it again about spelling flames that must contain a spelling
> error themselves?
>


Heh, whereas I meant "Constant Value", he might've been thinking of the
Windows-common "Count of Bytes" prefix.

--
- Shao Miller
--
"Thank you for the kind words; those are the kind of words I like to hear.

Cheerily," -- Richard Harter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sscanf'ing floats into structure members Bernard Liang C Programming 3 06-21-2006 09:06 PM
[FR/EN] how to convert the characters ASCII(0-255) to ASCII(0-127) Alextophi Perl Misc 8 12-30-2005 10:43 AM
Re: Is it safe to put 127.0.0.1 into ZA's trusted zone? Sandi Computer Security 1 03-06-2005 05:40 AM
isdigit() for characters greater than 127 Alf P. Steinbach C++ 4 10-09-2004 06:37 AM
filter special characters ( ascii > 127) in Change password kike Javascript 0 07-20-2004 01:13 AM



Advertisments