[BACK]Return to rlogin.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rlogin

Diff for /src/usr.bin/rlogin/Attic/rlogin.c between version 1.3 and 1.4

version 1.3, 1996/04/17 07:15:21 version 1.4, 1996/06/19 10:03:43
Line 256 
Line 256 
                 exit(1);                  exit(1);
         }          }
   
         (void)strcpy(term, (p = getenv("TERM")) ? p : "network");          (void)strncpy(term, (p = getenv("TERM")) ? p : "network",
               sizeof(term) - 1);
           term[sizeof(term) - 1] = '\0';
   
           /*
            * Add "/baud" only if there is room left; ie. do not send "/19"
            * for 19200 baud with a particularily long $TERM
            */
         if (tcgetattr(0, &tty) == 0) {          if (tcgetattr(0, &tty) == 0) {
                 (void)strcat(term, "/");                  char baud[20];          /* more than enough.. */
                 (void)sprintf(term + strlen(term), "%d", cfgetospeed(&tty));  
                   (void)sprintf(baud, "/%d", cfgetospeed(&tty));
                   if (strlen(term) + strlen(baud) < sizeof(term) - 1)
                           (void)strcat(term, baud);
         }          }
   
         (void)get_window_size(0, &winsize);          (void)get_window_size(0, &winsize);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4