Search:

Type: Posts; User: Salem

Search: Search took 0.19 seconds.

  1. You have no protection against buffer overrun of...

    You have no protection against buffer overrun of your arrays.

    I was thinking of


    while(fgets(buff,sizeof(buff),fd) != NULL) {
    if ( strstr(buff,"------") != NULL ) break;
    }

    i = 0;
  2. Look at my example again. You've still got...

    Look at my example again.

    You've still got fgets() inside fgets()
    Which means you're sometimes reading two lines at a time.
  3. > if(ps) The problem is, after you find...

    > if(ps)
    The problem is, after you find your magic marker, you only read ONE more line and that's it.

    You need two while loops



    // find the marker
    while ( fgets( ) ) {
    // found...
Results 1 to 3 of 3