Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdscat & sdscatsds in-place? #119

Open
drkameleon opened this issue Jan 8, 2020 · 1 comment
Open

sdscat & sdscatsds in-place? #119

drkameleon opened this issue Jan 8, 2020 · 1 comment

Comments

@drkameleon
Copy link

As I've read in the reference and source when you pass an sds string to these two functions, you always have to assign the pointer back.

Is there any workaround to make these functions work in-place? That is: pass them an sds and have it modified? (without changing the object's pointer)

@MCRusher
Copy link

I think you could make your own functions that take an sds pointer and assign to it with the original function, like

void sdscat_in_place(sds * sp, char * s){ *sp = sdscat(*sp,s); }

Otherwise I don't think there is any way for the original, which expects a copy of an address, to change the address of the original, which provided the copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants