Mail Archives: djgpp/1998/07/22/21:47:20
Jim Barlow (Jim_Barlow AT bc DOT sympatico DOT ca) wrote:
: int readthefile (char *filename) {
[Klippa, klapp, kluppit most of function.]
: if (cur == &first) { // if so, there are no occurences of 'staredit'
: return F_NOSTRINGS;
: }
: }
:
: long getfsize (FILE *fp) {
: fseek (fp, 0, SEEK_END);
: return ftell (fp);
: }
:
: // adds a new item to the list and returns the new item
: OFF_LIST *add_to_list (OFF_LIST *item, char *offset, int len) {
: OFF_LIST *newlist;
:
: item->next = newlist = (OFF_LIST *)safemalloc (sizeof(OFF_LIST));
: newlist->offset = offset;
: newlist->maxlen = len;
: newlist->next = NULL;
:
: return newlist;
: }
:
: For some reason, this function always returns F_NOWAVS even if the file consists
: completely of "mystringmystringmystringmysting...." What's wrong here?
Which function? If it's readthefile you mean, it's not returning
F_NOWAVS but garbage as you don't have return if you reach the end of
it.
New Model Army, Small Town England,
MartinS
- Raw text -