IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33203


Ignore:
Timestamp:
Feb 5, 2012, 12:33:29 PM (14 years ago)
Author:
eugene
Message:

working towards distributed dvo

Location:
branches/eam_branches/ipp-20111122/Ohana/src
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/libohana/src/string.c

    r33116 r33203  
    143143}
    144144
     145int scan_line_maxlen (FILE *f, char *line, int maxlen) {
     146
     147  int i, status;
     148  char c;
     149 
     150  status = EOF + 1;
     151 
     152  for (i = 0, c = 0; (c != '\n') && (status != EOF) && (i < maxlen); i++) {
     153    status = fscanf (f, "%c", &c);
     154    line[i] = c;
     155  }
     156  line[i - 1] = 0;  /* this could make things crash! */
     157
     158  if (i > 1) {
     159    status = EOF + 1;
     160  }
     161
     162  return (status);
     163}
     164
    145165char *_parse_nextword (char *string) {
    146166
Note: See TracChangeset for help on using the changeset viewer.