Thread View: comp.bugs.2bsd
1 messages
1 total messages
Started by Steven M. Schultz
Fri, 25 Aug 1989 05:59
lpd long file bug
Author: Steven M. Schultz
Date: Fri, 25 Aug 1989 05:59
Date: Fri, 25 Aug 1989 05:59
52 lines
1863 bytes
1863 bytes
Subject: lpd long file bug
Index: usr.lib/lpr/printjob.c 2.10BSD
Description:
two more "long" vs. "int" gotchas have surfaced in the "lpd"
program. one of these days the last of these long/int bugs
will be terminated!
Repeat-By:
by examination and trying to print a file longer than 32kb.
Fix:
Apply the following patch to lpr/printjob.c
*** printjob.c.old Sun Dec 25 23:52:14 1988
--- printjob.c Thu Aug 24 11:15:14 1989
***************
*** 705,711 ****
sendfile(type, file)
char type, *file;
{
! register int f, i, amt;
struct stat stb;
char buf[BUFSIZ];
int sizerr, resp;
--- 705,712 ----
sendfile(type, file)
char type, *file;
{
! register int f, amt;
! long i;
struct stat stb;
char buf[BUFSIZ];
int sizerr, resp;
***************
*** 720,726 ****
if ((stb.st_mode & S_IFMT) == S_IFLNK && fstat(f, &stb) == 0 &&
(stb.st_dev != fdev || stb.st_ino != fino))
return(ACCESS);
! (void) sprintf(buf, "%c%d %s\n", type, stb.st_size, file);
amt = strlen(buf);
for (i = 0; ; i++) {
if (write(pfd, buf, amt) != amt ||
--- 721,727 ----
if ((stb.st_mode & S_IFMT) == S_IFLNK && fstat(f, &stb) == 0 &&
(stb.st_dev != fdev || stb.st_ino != fino))
return(ACCESS);
! (void) sprintf(buf, "%c%ld %s\n", type, stb.st_size, file);
amt = strlen(buf);
for (i = 0; ; i++) {
if (write(pfd, buf, amt) != amt ||
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