166 lines
5.8 KiB
Plaintext
166 lines
5.8 KiB
Plaintext
*** efax.c.orig Sat Sep 5 14:33:25 1998
|
|
--- efax.c Sat Sep 5 14:40:41 1998
|
|
***************
|
|
*** 565,571 ****
|
|
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 ) ;
|
|
--- 565,571 ----
|
|
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 ) ;
|
|
***************
|
|
*** 1552,1558 ****
|
|
if ( done ) continue ;
|
|
|
|
if ( 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 ) ) continue ;
|
|
--- 1552,1558 ----
|
|
if ( done ) continue ;
|
|
|
|
if ( 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 ) ) continue ;
|
|
***************
|
|
*** 1697,1703 ****
|
|
int err=0, hsc=-1 ;
|
|
char c, dsbuf [ 128 ] ;
|
|
|
|
! sprintf ( dsbuf, nowait ? "D%.126s;" : "D%.127s" , s ) ;
|
|
msg ( "Idialing %s", dsbuf+1 ) ;
|
|
|
|
c = cmd ( f, dsbuf, TO_A ) ;
|
|
--- 1697,1703 ----
|
|
int err=0, hsc=-1 ;
|
|
char c, dsbuf [ 128 ] ;
|
|
|
|
! snprintf ( dsbuf, sizeof dsbuf, nowait ? "D%.126s;" : "D%.127s" , s ) ;
|
|
msg ( "Idialing %s", dsbuf+1 ) ;
|
|
|
|
c = cmd ( f, dsbuf, TO_A ) ;
|
|
***************
|
|
*** 1820,1826 ****
|
|
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:" ) ;
|
|
--- 1820,1826 ----
|
|
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:" ) ;
|
|
***************
|
|
*** 1839,1845 ****
|
|
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:" ) ;
|
|
--- 1839,1845 ----
|
|
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:" ) ;
|
|
***************
|
|
*** 1894,1905 ****
|
|
|
|
ckcmd ( mf, &err, "+FCR=1", t, OK ) ;
|
|
|
|
! 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 ) ;
|
|
|
|
--- 1894,1905 ----
|
|
|
|
ckcmd ( mf, &err, "+FCR=1", t, OK ) ;
|
|
|
|
! 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 ) ;
|
|
|
|
***************
|
|
*** 1907,1913 ****
|
|
|
|
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 ) ;
|
|
|
|
--- 1907,1913 ----
|
|
|
|
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 ) ;
|
|
|
|
***************
|
|
*** 1989,1995 ****
|
|
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 ;
|
|
--- 1989,1995 ----
|
|
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 ;
|
|
***************
|
|
*** 2089,2095 ****
|
|
char tmp [ MAXLINELEN ] ;
|
|
now = time ( 0 ) ;
|
|
strftime ( tmp, MAXLINELEN, "%c %%s P. %%%%d", localtime ( &now ) ) ;
|
|
! sprintf ( header = headerbuf, tmp, localid ) ;
|
|
}
|
|
|
|
sigf = &faxdev ; /* make global so can clean up on signal */
|
|
--- 2089,2095 ----
|
|
char tmp [ MAXLINELEN ] ;
|
|
now = time ( 0 ) ;
|
|
strftime ( tmp, MAXLINELEN, "%c %%s P. %%%%d", localtime ( &now ) ) ;
|
|
! snprintf ( header = headerbuf, sizeof headerbuf, tmp, localid ) ;
|
|
}
|
|
|
|
sigf = &faxdev ; /* make global so can clean up on signal */
|