#include #include #include "aplinks.h" int chk_bps(int argc, char *argv[], unsigned int *bps) { int i, j; char bps_buffer[6]; int len; *bps = (unsigned int)DEFAULT_BPS; for(i = 1; i < argc; i++){ if(strncmp(argv[i], "-B", 2) == 0){ strcpy(bps_buffer, argv[i] + 2); len = strlen(bps_buffer); *bps = 0; for(j = 0; j < len; j++){ *bps = ((*bps) * 10) + (bps_buffer[j] - '0'); } } } return 0; }