* Compare two dStrs. */
| 476 | * Compare two dStrs. |
| 477 | */ |
| 478 | int dStr_cmp(Dstr *ds1, Dstr *ds2) |
| 479 | { |
| 480 | int ret = 0; |
| 481 | |
| 482 | if (ds1 && ds2) |
| 483 | ret = memcmp(ds1->str, ds2->str, MIN(ds1->len+1, ds2->len+1)); |
| 484 | return ret; |
| 485 | } |
| 486 | |
| 487 | /** |
| 488 | * Return a pointer to the first occurrence of needle in haystack. |