2007/6/29, Andrew Fyfe <andrew@neptune-one.net>:
- newstr = strdup(depstring); + + newstr = calloc(strlen(depstring)+1, sizeof(char)); + strncpy(newstr, depstring, strlen(depstring));
hmm, that's basically the same, isn't it? :)
- - /* splitdep modifies the string... we'll compensate for now */ - char *saved_target = NULL; - saved_target = calloc(strlen(target)+1, sizeof(char)); - strncpy(saved_target, target, strlen(target)); -
Wow, now I'm confused, I didn't know about this code. I'm afraid I only looked at the backend code, and not frontend, when Dan asked this : http://www.archlinux.org/pipermail/pacman-dev/2007-June/008595.html Was that a workaround for a feature or for a bug ? commit is there : http://projects.archlinux.org/git/gitweb.cgi?p=pacman.git;a=commitdiff;h=6f8... Any reasons this wasn't directly made in splitdep instead, like Nagy did : http://www.archlinux.org/pipermail/pacman-dev/2007-June/008535.html ? It really looked like a bug to me, but this workaround confuses me.