[Olsr-cvs] olsrd-current/src/olsr_switch ohs_cmd.c,1.17,1.18

Thomas Lopatic (spam-protected)
Sun Oct 23 21:17:50 CEST 2005


Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28555/src/olsr_switch

Modified Files:
	ohs_cmd.c 
Log Message:
olsr_switch now works again on Linux, too.


Index: ohs_cmd.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/ohs_cmd.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ohs_cmd.c	23 Oct 2005 19:01:04 -0000	1.17
--- ohs_cmd.c	23 Oct 2005 19:17:48 -0000	1.18
***************
*** 596,607 ****
    fflush(stdout);
  
- #else
-   c = fgetc(stdin);
- #endif
- 
    if (c != '\n' && c != '\r' && cmd_len < (int)sizeof (cmd_line) - 1)
      cmd_line[cmd_len++] = (char)c;
  
    else
    {
      cmd_line[cmd_len] = 0;
--- 596,610 ----
    fflush(stdout);
  
    if (c != '\n' && c != '\r' && cmd_len < (int)sizeof (cmd_line) - 1)
      cmd_line[cmd_len++] = (char)c;
  
    else
+ #else
+   fgets(cmd_line, sizeof (cmd_line), stdin);
+ 
+   for (cmd_len = 0; cmd_line[cmd_len] != 0 && cmd_line[cmd_len] != '\n';
+        cmd_len++);
+ #endif
+ 
    {
      cmd_line[cmd_len] = 0;





More information about the Olsr-cvs mailing list