*** efax.c.orig Sat Mar 27 06:24:10 1999 --- efax.c Thu Aug 19 13:33:41 1999 *************** *** 606,612 **** if ( ckfmt ( header, 6 ) ) msg ( "W too many %%d escapes in header format string \"%s\"", header ) ; else ! sprintf ( headerbuf, header, page, pages, page, pages, page, pages ) ; msg ("I header:[%s]", headerbuf ) ; done = err = ttymode ( mf, SEND ) ; --- 606,612 ---- if ( ckfmt ( header, 6 ) ) msg ( "W too many %%d escapes in header format string \"%s\"", header ) ; else ! snprintf ( headerbuf, sizeof headerbuf, header, page, pages, page, pages, page, pages ) ; msg ("I header:[%s]", headerbuf ) ; done = err = ttymode ( mf, SEND ) ; *************** *** 1658,1664 **** err = rdpage ( inf, dp, &ppm, local, &changed ) ; if ( ! err && changed ) { ! sprintf ( buf, c20 ? "+FIS=%d,%d,%d,%d" : "+FDIS=%d,%d,%d,%d", local[0], local[1], local[2], local[3] ) ; ckcmd ( mf, 0, buf, TO_FT, OK ) ; if ( gethsc ( &hsc, &err ) ) { --- 1658,1665 ---- err = rdpage ( inf, dp, &ppm, local, &changed ) ; if ( ! err && changed ) { ! snprintf ( buf, sizeof buf, ! c20 ? "+FIS=%d,%d,%d,%d" : "+FDIS=%d,%d,%d,%d", local[0], local[1], local[2], local[3] ) ; ckcmd ( mf, 0, buf, TO_FT, OK ) ; if ( gethsc ( &hsc, &err ) ) { *************** *** 1816,1822 **** int err=0, hsc=-1 ; char c, dsbuf [ 128 ], *p ; ! sprintf ( dsbuf, nowait ? "D%.126s;" : "D%.127s" , s ) ; msg ( "Idialing %s", dsbuf+1 ) ; c = cmd ( f, dsbuf, TO_A ) ; --- 1817,1823 ---- int err=0, hsc=-1 ; char c, dsbuf [ 128 ], *p ; ! snprintf ( dsbuf, sizeof dsbuf, nowait ? "D%.126s;" : "D%.127s" , s ) ; msg ( "Idialing %s", dsbuf+1 ) ; c = cmd ( f, dsbuf, TO_A ) ; *************** *** 1944,1950 **** if ( ckfmt ( getty, 6 ) ) { err = msg ( "E3 too many %%d escapes in command (%s)", getty ) ; } else { ! sprintf ( buf, getty, crate, crate, crate, crate, crate, crate ) ; msg ( "Iexec'ing /bin/sh -c \"%s\"" , buf ) ; execl ( "/bin/sh" , "sh" , "-c" , buf , (void*) 0 ) ; err = msg ( "ES2exec failed:" ) ; --- 1945,1951 ---- if ( ckfmt ( getty, 6 ) ) { err = msg ( "E3 too many %%d escapes in command (%s)", getty ) ; } else { ! snprintf ( buf, sizeof buf, getty, crate, crate, crate, crate, crate, crate ) ; msg ( "Iexec'ing /bin/sh -c \"%s\"" , buf ) ; execl ( "/bin/sh" , "sh" , "-c" , buf , (void*) 0 ) ; err = msg ( "ES2exec failed:" ) ; *************** *** 1963,1969 **** char buf [ MAXGETTY ] ; if ( ckfmt ( vcmd, 6 ) ) { } else { ! sprintf ( buf, vcmd, f->fd, f->fd, f->fd, f->fd, f->fd, f->fd ) ; msg ( "Iexec'ing /bin/sh -c \"%s\"" , buf ) ; execl ( "/bin/sh" , "sh" , "-c" , buf , (void*) 0 ) ; err = msg ( "ES2exec failed:" ) ; --- 1964,1970 ---- char buf [ MAXGETTY ] ; if ( ckfmt ( vcmd, 6 ) ) { } else { ! snprintf ( buf, sizeof buf, vcmd, f->fd, f->fd, f->fd, f->fd, f->fd, f->fd ) ; msg ( "Iexec'ing /bin/sh -c \"%s\"" , buf ) ; execl ( "/bin/sh" , "sh" , "-c" , buf , (void*) 0 ) ; err = msg ( "ES2exec failed:" ) ; *************** *** 2090,2102 **** } if ( capsset ) { ! sprintf ( buf, c20 ? "+FCC=%d,%d,%d,%d,%d,%d,%d,%d" : "+FDCC=%d,%d,%d,%d,%d,%d,%d,%d", c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7] ) ; ckcmd ( mf, 0, buf, -t, OK ) ; } ! sprintf ( buf, c20 ? "+FLI=\"%.*s\"" : "+FLID=\"%.*s\"" , CMDBUFSIZE-9, id ) ; ckcmd ( mf, 0, buf, -t, OK ) ; --- 2091,2103 ---- } if ( capsset ) { ! snprintf ( buf, sizeof buf, c20 ? "+FCC=%d,%d,%d,%d,%d,%d,%d,%d" : "+FDCC=%d,%d,%d,%d,%d,%d,%d,%d", c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7] ) ; ckcmd ( mf, 0, buf, -t, OK ) ; } ! snprintf ( buf, sizeof buf, c20 ? "+FLI=\"%.*s\"" : "+FLID=\"%.*s\"" , CMDBUFSIZE-9, id ) ; ckcmd ( mf, 0, buf, -t, OK ) ; *************** *** 2104,2110 **** ckcmd ( mf, 0, c20 ? "+FSP=1" : "+FSPL=1", -t, OK ) ; ! sprintf ( buf, c20 ? "+FPI=\"%.*s\"" : "+FCIG=\"%.*s\"" , CMDBUFSIZE-9, id ) ; ckcmd ( mf, 0, buf, -t, OK ) ; --- 2105,2111 ---- ckcmd ( mf, 0, c20 ? "+FSP=1" : "+FSPL=1", -t, OK ) ; ! snprintf(buf, sizeof buf, c20 ? "+FPI=\"%.*s\"" : "+FCIG=\"%.*s\"" , CMDBUFSIZE-9, id ) ; ckcmd ( mf, 0, buf, -t, OK ) ; *************** *** 2209,2215 **** msg("Wlocal ID (%s) truncated to %d characters", nxtoptarg, IDLEN ) ; if ( strspn ( nxtoptarg, " +0123456789" ) != strlen ( nxtoptarg ) ) msg("Wlocal ID (%s) has non-standard characters", nxtoptarg ) ; ! sprintf ( localid, "%*.*s", IDLEN, IDLEN, nxtoptarg ) ; break ; case 'i': if ( nicmd[0] < MAXICMD ) icmd[0][ nicmd[0]++ ] = nxtoptarg ; --- 2210,2216 ---- msg("Wlocal ID (%s) truncated to %d characters", nxtoptarg, IDLEN ) ; if ( strspn ( nxtoptarg, " +0123456789" ) != strlen ( nxtoptarg ) ) msg("Wlocal ID (%s) has non-standard characters", nxtoptarg ) ; ! snprintf ( localid, sizeof localid, "%*.*s", IDLEN, IDLEN, nxtoptarg ) ; break ; case 'i': if ( nicmd[0] < MAXICMD ) icmd[0][ nicmd[0]++ ] = nxtoptarg ; *************** *** 2307,2313 **** char tmp [ MAXLINELEN ] ; now = time ( 0 ) ; strftime ( tmp, MAXLINELEN, "%c %%s P. %%%%d", localtime ( &now ) ) ; ! sprintf ( header = headerbuf, tmp, localid ) ; } if ( ! err ) { --- 2308,2314 ---- char tmp [ MAXLINELEN ] ; now = time ( 0 ) ; strftime ( tmp, MAXLINELEN, "%c %%s P. %%%%d", localtime ( &now ) ) ; ! snprintf ( header = headerbuf, sizeof headerbuf, tmp, localid ) ; } if ( ! err ) {