Changes in kernel/generic/src/lib/str.c [1772e6d:1066041] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/str.c
r1772e6d r1066041 111 111 #include <debug.h> 112 112 #include <macros.h> 113 #include <mm/slab.h> 113 114 114 115 /** Check the condition if wchar_t is signed */ … … 456 457 * 457 458 * Do a char-by-char comparison of two NULL-terminated strings. 458 * The strings are considered equal iff their length is equal 459 * and both strings consist of the same sequence of characters. 460 * 461 * A string S1 is less than another string S2 if it has a character with 462 * lower value at the first character position where the strings differ. 463 * If the strings differ in length, the shorter one is treated as if 464 * padded by characters with a value of zero. 459 * The strings are considered equal iff they consist of the same 460 * characters on the minimum of their lengths. 465 461 * 466 462 * @param s1 First string to compare. 467 463 * @param s2 Second string to compare. 468 464 * 469 * @return 0 if the strings are equal, -1 if the first is less than the second,470 * 1 if the second is less than the first.465 * @return 0 if the strings are equal, -1 if first is smaller, 466 * 1 if second smaller. 471 467 * 472 468 */ … … 499 495 * 500 496 * Do a char-by-char comparison of two NULL-terminated strings. 501 * The strings are considered equal iff 502 * min(str_length(s1), max_len) == min(str_length(s2), max_len) 503 * and both strings consist of the same sequence of characters, 504 * up to max_len characters. 505 * 506 * A string S1 is less than another string S2 if it has a character with 507 * lower value at the first character position where the strings differ. 508 * If the strings differ in length, the shorter one is treated as if 509 * padded by characters with a value of zero. Only the first max_len 510 * characters are considered. 497 * The strings are considered equal iff they consist of the same 498 * characters on the minimum of their lengths and the length limit. 511 499 * 512 500 * @param s1 First string to compare. … … 514 502 * @param max_len Maximum number of characters to consider. 515 503 * 516 * @return 0 if the strings are equal, -1 if the first is less than the second,517 * 1 if the second is less than the first.504 * @return 0 if the strings are equal, -1 if first is smaller, 505 * 1 if second smaller. 518 506 * 519 507 */ … … 567 555 /* There must be space for a null terminator in the buffer. */ 568 556 ASSERT(size > 0); 557 ASSERT(src != NULL); 569 558 570 559 size_t src_off = 0;
Note:
See TracChangeset
for help on using the changeset viewer.