🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by MAILER-DAEMON Fri, 23 May 1986 08:48
core dump and bad total length of j
#310
Author: MAILER-DAEMON
Date: Fri, 23 May 1986 08:48
68 lines
2965 bytes
Subject: core dump and bad total length of jobs from uuq -l
Index:	/usr/src/usr.bin/uucp/uuq.c 2.9+bsd

Description:
	As above.  
Repeat-By:
	queue up a bunch of jobs.  run uuq -l.  Notice that 
	uuq -l gives you the wrong total length and then dumps core.
Fix:
	Replace a couple of printf("%d", long-value)'s with "... %ld...":
*** /tmp/,RCSt1010028	Fri May 23 04:45:05 1986
--- uuq.c	Fri May 23 04:35:56 1986
***************
*** 130,136
  			/* The 80 * njobs is because of the uucp handshaking */
  			minutes = (float)(sp->s_bytes + 80 * sp->s_njobs)/baudrate;
  			hours = minutes/60;
! 			printf(", %d bytes, ", sp->s_bytes);
  			if (minutes > 60){
  				printf("%d hour%s, ",hours,
  					hours > 1 ? "s": "");

--- 130,136 -----
  			/* The 80 * njobs is because of the uucp handshaking */
  			minutes = (float)(sp->s_bytes + 80 * sp->s_njobs)/baudrate;
  			hours = minutes/60;
! 			printf(", %ld bytes, ", sp->s_bytes);
  			if (minutes > 60){
  				printf("%d hour%s, ",hours,
  					hours > 1 ? "s": "");
***************
*** 142,149
  		if (hflag)
  			continue;
  		/* sort them babies! */
! 		sortjob = (struct job **)calloc(sp->s_njobs, sizeof (struct job
!  *));
  		for (i=0, jp=sp->s_jobp; i < sp->s_njobs; i++, jp=jp->j_jobp)
  			sortjob[i] = jp;
  		qsort(sortjob, sp->s_njobs, sizeof (struct job *), jcompare);

--- 142,148 -----
  		if (hflag)
  			continue;
  		/* sort them babies! */
! 		sortjob = (struct job **)calloc(sp->s_njobs, sizeof (struct job *));
  		for (i=0, jp=sp->s_jobp; i < sp->s_njobs; i++, jp=jp->j_jobp)
  			sortjob[i] = jp;
  		qsort(sortjob, sp->s_njobs, sizeof (struct job *), jcompare);
***************
*** 150,156
  		for (i = 0; i < sp->s_njobs; i++) {
  			jp = sortjob[i];
  			if (lflag) {
! 				printf("%s %2d %-*s%7d%5.1f %-12.12s %c %.*s\n",
  	jp->j_jobno, jp->j_files, Maxulen, jp->j_user, jp->j_bytes, jp->j_bytes/baudrate,
  	ctime(&jp->j_date) + 4, jp->j_flags, sizeof (jp->j_fname), jp->j_fname
  				);

--- 149,155 -----
  		for (i = 0; i < sp->s_njobs; i++) {
  			jp = sortjob[i];
  			if (lflag) {
! 				printf("%s %2d %-*s%7ld%5.1f %-12.12s %c %.*s\n",
  	jp->j_jobno, jp->j_files, Maxulen, jp->j_user, jp->j_bytes, jp->j_bytes/baudrate,
  	ctime(&jp->j_date) + 4, jp->j_flags, sizeof (jp->j_fname), jp->j_fname
  				);
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