path: root/builtin
diff options
authorJeff King <>2014-06-19 21:58:10 (GMT)
committerJunio C Hamano <>2014-06-20 17:45:19 (GMT)
commit67a31f612830e79fe768ac886ed9ef7eadd8fb10 (patch)
tree71b4f4ec65f9be778404748baa69736839d6d786 /builtin
parent59a642f8ac42c6cd11f63175689aa21b27ce1a6a (diff)
http-push: refactor parsing of remote object names
We get loose object names like "objects/??/..." from the remote side, and need to convert them to their hex representation. The code to do so is rather hard to follow, as it uses some calculated lengths whose origins are hard to understand and verify (e.g., the path must be exactly 49 characters long. why? Why doesn't the strcpy overflow obj_hex, which is the same length as path?). We can simplify this a bit by using skip_prefix, using standard 40- and 20-character buffers for hex and binary sha1s, and adding some comments. We also drop a totally bogus comment that claims strlcpy cannot be used because "path" is not NUL-terminated. Right between a call to strlen(path) and strcpy(path). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin')
0 files changed, 0 insertions, 0 deletions