Append the specified binary-safe string pointed by 't' of 'len' bytes to the * end of the specified sds string 's'. * * After the call, the passed sds string is no longer valid and all the * references must be substituted with the new pointer returned by the call. */
| 395 | * After the call, the passed sds string is no longer valid and all the |
| 396 | * references must be substituted with the new pointer returned by the call. */ |
| 397 | sds sdscatlen(sds s, const void *t, size_t len) { |
| 398 | size_t curlen = sdslen(s); |
| 399 | |
| 400 | s = sdsMakeRoomFor(s,len); |
| 401 | if (s == NULL) return NULL; |
| 402 | memcpy(s+curlen, t, len); |
| 403 | sdssetlen(s, curlen+len); |
| 404 | s[curlen+len] = '\0'; |
| 405 | return s; |
| 406 | } |
| 407 | |
| 408 | /* Append the specified null termianted C string to the sds string 's'. |
| 409 | * |
no test coverage detected