Changes in uspace/lib/c/generic/str.c [059a8e4:8e893ae] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str.c
r059a8e4 r8e893ae 46 46 #include <mem.h> 47 47 #include <str.h> 48 49 /** Check the condition if wchar_t is signed */ 50 #ifdef WCHAR_IS_UNSIGNED 51 #define WCHAR_SIGNED_CHECK(cond) (true) 52 #else 53 #define WCHAR_SIGNED_CHECK(cond) (cond) 54 #endif 48 55 49 56 /** Byte mask consisting of lowest @n bits (out of 8) */ … … 399 406 bool ascii_check(wchar_t ch) 400 407 { 401 if ( (ch >= 0) && (ch <= 127))408 if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127)) 402 409 return true; 403 410 … … 412 419 bool chr_check(wchar_t ch) 413 420 { 414 if ( (ch >= 0) && (ch <= 1114111))421 if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111)) 415 422 return true; 416 423 … … 513 520 * @param count Size of the destination buffer (must be > 0). 514 521 * @param src Source string. 522 * 515 523 */ 516 524 void str_cpy(char *dest, size_t size, const char *src) … … 545 553 * @param src Source string. 546 554 * @param n Maximum number of bytes to read from @a src. 555 * 547 556 */ 548 557 void str_ncpy(char *dest, size_t size, const char *src, size_t n)
Note:
See TracChangeset
for help on using the changeset viewer.