*** ahjut.c 2005-07-09 20:17:22.000000000 +0900 --- ahjut.c.orig 2005-02-24 07:03:09.000000000 +0900 *************** *** 45,68 **** { extern char *optarg; extern int optind, opterr, optopt; ! char cmd[128]; char *rsp; size_t sz; ! int c, p = 0; /* オプション解析 */ ! while((c = getopt(argc, argv, "l:d:p:")) != -1){ if(c == 'l'){ strcpy(rsdevice, optarg); }else if(c == 'd'){ if(*optarg == '1' || *optarg == '2'){ dbg = *optarg - '0'; } - }else if(c == 'p'){ - p = atoi(optarg) % 10000; - if(p < 0) p = -p; }else{ ! printf("usage: ahjut [-l ttydevice] [-d [1|2]] [-p password]\n"); exit(1); } } --- 45,65 ---- { extern char *optarg; extern int optind, opterr, optopt; ! char *cmd; char *rsp; size_t sz; ! int c; /* オプション解析 */ ! while((c = getopt(argc, argv, "l:d:")) != -1){ if(c == 'l'){ strcpy(rsdevice, optarg); }else if(c == 'd'){ if(*optarg == '1' || *optarg == '2'){ dbg = *optarg - '0'; } }else{ ! printf("usage: ahjut [-l ttydevice] [-d 1|2]\n"); exit(1); } } *************** *** 94,100 **** block_mode(ON); /* 転送処理開始 */ ! snprintf(cmd, sizeof(cmd), "FT_START[%04d]\r\n", p); if(dbg) printf("-->%s", cmd); senddata(strlen(cmd), cmd); --- 91,97 ---- block_mode(ON); /* 転送処理開始 */ ! cmd = "FT_START[0000]\r\n"; if(dbg) printf("-->%s", cmd); senddata(strlen(cmd), cmd);