• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reading in dictionary from txt file: options for speed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading in dictionary from txt file: options for speed


  • Subject: Re: Reading in dictionary from txt file: options for speed
  • From: Michael Ash <email@hidden>
  • Date: Thu, 16 Apr 2009 21:59:33 -0400

On Thu, Apr 16, 2009 at 2:47 PM, WT <email@hidden> wrote:
> Marcel,
>
> since he'll be dealing with the string's raw bytes, won't Miles have to
> manually add a null byte to terminate the search string?

The strnstr() function takes a length, and can thus be safely used on
buffers which contain no NUL byte.

On Tiger and earlier, strnstr() had a bug where it could read one byte
past the length specified, which could cause a crash in certain
circumstances. Had a grand old time tracking that one down, I did. It
was eventually fixed in a security update, and I believe it was fixed
in Leopard from the start.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Reading in dictionary from txt file: options for speed
      • From: Marcel Weiher <email@hidden>
References: 
 >Reading in dictionary from txt file: options for speed (From: Miles <email@hidden>)
 >Re: Reading in dictionary from txt file: options for speed (From: Marcel Weiher <email@hidden>)
 >Re: Reading in dictionary from txt file: options for speed (From: WT <email@hidden>)
 >Re: Reading in dictionary from txt file: options for speed (From: Miles <email@hidden>)
 >Re: Reading in dictionary from txt file: options for speed (From: Marcel Weiher <email@hidden>)
 >Re: Reading in dictionary from txt file: options for speed (From: WT <email@hidden>)

  • Prev by Date: Re: NSView modifies CALayer's masksToBounds?
  • Next by Date: [SOLVED] Re: NSView modifies CALayer's masksToBounds?
  • Previous by thread: Re: Reading in dictionary from txt file: options for speed
  • Next by thread: Re: Reading in dictionary from txt file: options for speed
  • Index(es):
    • Date
    • Thread