fiddle with 8 bit characters, start to check everything more rigourously
[spider.git] / src / client.c
index 7864e9d13dc70cfab79b90f3f98e118ea7c7e47d..c330536bf3a15e6c52ed21987692a55a2258a95a 100644 (file)
@@ -44,7 +44,7 @@
 #define MAXPATHLEN 256
 #endif
 
-#define DEFPACLEN 128
+#define DEFPACLEN 236
 #define MAXPACLEN 236
 #define MAXCALLSIGN 9
 
@@ -387,6 +387,8 @@ int fcb_handler(sel_t *sp, int in, int out, int err)
                                default:
                                        if (nl == '\n' && *p == '\r') {   /* ignore \r in telnet mode (ugh) */
                                                p++;
+                                       } else if (nl == '\r' && *p == '\n') {  /* and ignore \n in ax25 mode (double ugh) */
+                                               p++;
                                        } else if (*p == nl) {
                                                if (mp->inp == mp->data)
                                                        *mp->inp++ = ' ';
@@ -446,12 +448,10 @@ int fcb_handler(sel_t *sp, int in, int out, int err)
 
                                case 1:
                                        mp->state = 2;
-                                       if (ch >= '0' && ch <= '9') 
+                                       if (ch >= '2' && ch <= '9') 
                                                c = (ch - '0') << 4;
                                        else if (ch >= 'A' && ch <= 'F')
                                                c = (ch - 'A' + 10) << 4;
-                                       else if (ch >= 'a' && ch <= 'a')
-                                               c = (ch - 'a' + 10) << 4;
                                        else {
                                                dbg(DMSG, "Illegal hex char (%c) received in state %d", ch, mp->state);
                                                mp->inp = mp->data;
@@ -464,8 +464,6 @@ int fcb_handler(sel_t *sp, int in, int out, int err)
                                                *mp->inp++ = c | (ch - '0');
                                        else if (ch >= 'A' && ch <= 'F')
                                                *mp->inp++ = c | (ch - 'A' + 10);
-                                       else if (ch >= 'a' && ch <= 'a')
-                                               *mp->inp++ = c | (ch - 'a' + 10);
                                        else {
                                                dbg(DMSG, "Illegal hex char (%c) received in state %d", ch, mp->state);
                                                mp->inp = mp->data;