VirtualBox

Changeset 1806 in kBuild


Ignore:
Timestamp:
Oct 9, 2008 5:34:29 AM (16 years ago)
Author:
bird
Message:

kmk: readstring - use memchr.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/read.c

    r1797 r1806  
    28032803{
    28042804  char *eol;
     2805#ifdef KMK
     2806  char *end;
     2807#endif
    28052808
    28062809  /* If there is nothing left in this buffer, return 0.  */
     
    28122815
    28132816  eol = ebuf->buffer = ebuf->bufnext;
     2817#ifdef KMK
     2818  end = ebuf->bufstart + ebuf->size;
     2819#endif
    28142820
    28152821  while (1)
     
    28202826
    28212827      /* Find the next newline.  At EOS, stop.  */
     2828#ifndef KMK
    28222829      eol = p = strchr (eol , '\n');
     2830#else
     2831      p = (char *)memchr (eol, '\n', end - eol);
     2832      assert (!memchr (eol, '\0', p != 0 ? p - eol : end - eol));
     2833      eol = p;
     2834#endif
    28232835      if (!eol)
    28242836        {
     2837
    28252838          ebuf->bufnext = ebuf->bufstart + ebuf->size + 1;
    28262839          return 0;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette