len = E_INC;
else
len = E_SET;
- speakup_s2i(cp, &value);
+ value = simple_strtol(cp, NULL, 10);
ret = spk_set_num_var(value, param, len);
if (ret == E_RANGE) {
var_data = param->data;
spk_special_handler = NULL;
return 1;
}
- cp = speakup_s2i(goto_buf, &go_pos);
+ go_pos = simple_strtol(goto_buf, &cp, 10);
goto_pos = (u_long) go_pos;
if (*cp == 'x') {
if (*goto_buf < '0')
void spk_get_index_count(int *linecount, int *sentcount);
extern int spk_set_key_info(const u_char *key_info, u_char *k_buffer);
extern char *spk_strlwr(char *s);
-extern char *speakup_s2i(char *start, int *dest);
extern char *spk_s2uchar(char *start, char *dest);
extern char *spk_xlate(char *s);
extern int speakup_kobj_init(void);
return s;
}
-char *speakup_s2i(char *start, int *dest)
-{
- int val;
- char ch = *start;
- if (ch == '-' || ch == '+')
- start++;
- if (*start < '0' || *start > '9')
- return start;
- val = (*start) - '0';
- start++;
- while (*start >= '0' && *start <= '9') {
- val *= 10;
- val += (*start) - '0';
- start++;
- }
- if (ch == '-')
- *dest = -val;
- else
- *dest = val;
- return start;
-}
-
char *spk_s2uchar(char *start, char *dest)
{
int val = 0;
- while (*start && *start <= SPACE)
- start++;
- while (*start >= '0' && *start <= '9') {
- val *= 10;
- val += (*start) - '0';
- start++;
- }
+ val = simple_strtoul(skip_spaces(start), &start, 10);
if (*start == ',')
start++;
*dest = (u_char)val;