version 1.39, 2011/04/30 22:24:31 |
version 1.40, 2011/05/01 08:38:56 |
|
|
#endif |
#endif |
|
|
#include <assert.h> |
#include <assert.h> |
|
#include <ctype.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
Line 135 mchars_res2cp(struct mchars *arg, const char *p, size_ |
|
Line 136 mchars_res2cp(struct mchars *arg, const char *p, size_ |
|
return(ln->unicode); |
return(ln->unicode); |
} |
} |
|
|
|
|
/* |
/* |
* Numbered character to literal character. |
* Numbered character to literal character. |
|
* This can only be a printable character (i.e., alnum, punct, space) so |
|
* prevent the character from ruining our state (backspace, newline, and |
|
* so on). |
*/ |
*/ |
char |
char |
mchars_num2char(const char *p, size_t sz) |
mchars_num2char(const char *p, size_t sz) |
Line 148 mchars_num2char(const char *p, size_t sz) |
|
Line 151 mchars_num2char(const char *p, size_t sz) |
|
return('\0'); |
return('\0'); |
|
|
i = atoi(p); |
i = atoi(p); |
/* |
return(isprint(i) ? (char)i : '\0'); |
* FIXME: |
|
* This is wrong. Anything could be written here! |
|
* This should be carefully screened for possible characters. |
|
*/ |
|
return(i <= 0 || i > 255 ? '\0' : (char)i); |
|
} |
} |
|
|
|
|
/* |
/* |
* Special character to string array. |
* Special character to string array. |
*/ |
*/ |
Line 172 mchars_spec2str(struct mchars *arg, const char *p, siz |
|
Line 169 mchars_spec2str(struct mchars *arg, const char *p, siz |
|
*rsz = strlen(ln->ascii); |
*rsz = strlen(ln->ascii); |
return(ln->ascii); |
return(ln->ascii); |
} |
} |
|
|
|
|
/* |
/* |
* Reserved word to string array. |
* Reserved word to string array. |