🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by dan Wed, 06 Feb 1985 22:20
newsinput.c problem for long names.
#220
Author: dan
Date: Wed, 06 Feb 1985 22:20
61 lines
2194 bytes
There is another problem with newsinput.c....When receiving an article from
a path:  xx!yy!uu!user   The author's system & name are put into the correct
arrays, but the loops have the wrong termination variables.  The system
name terminates when it overflows NAMESZ  &  the author names terminates
when it overflows SYSSZ.   What I did was to simply change the code, thus:
-------------------Start of Code-----------
		/* 
		 * TEMPORARY KLUDGE...
		 * throw out domain part until host
		 * name length increased
		 */
		if ((c = line[j + i]) == '\0' || c == '.')
		    break;
		origsys[i] = c;
	    }
	    origsys[i] = '\0';
	}
	else
	{						/* host!user */
	    int     delim = j;

	    line[delim] = '\0';				/* drop uucp route */
	    for (i = delim - 1; i > 0; i--)
	    {
		if (line[i] == '!' || line[i] == ':')
		{
		    i++;
		    break;
		}
	    }
	    j = i;					/* copy host */
+	    for (i = 0; i < (SYSSZ - 1); i++)
	    {
		if ((c = line[j + i]) == '\0')
		    break;
		origsys[i] = c;
	    }
	    origsys[i] = '\0';
	    j = delim + 1;				/* copy user */
+	    for (i = 0; i < (NAMESZ - 1); i++)
	    {
		if ((c = line[j + i]) == '\0')
		    break;
		authname[i] = c;
	    }
	    authname[i] = '\0';
	}
    /* 
     * get fromsys, which is the first host in path
     */
    if (p = index (line, '!'))
    {
	*p = '\0';
	strncpy (fromsys, line, SYSSZ - 1);
    }
    else
	strcpy (fromsys, origsys);
}
-----------End of change, also the EOF of newsinput.c---------
Note: the + lines are the only ones that actually changed.  -Dan A. Dickey
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads