Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH] Handle the errors from chdir in set_work_tree

From: Alex Riesen <hidden>
Date: 2016-06-15 22:43:25

Possibly related (same subject, not in this thread)

Junio C Hamano, Thu, Aug 02, 2007 23:58:41 +0200:
"Alex Riesen" [off-list ref] writes:
quoted
+		if (chdir(dir))
+			rel = NULL;
...
Shouldn't it die() instead, though?
Dunno. Don't like dying.
Consolidating two of your patches, would this be Ok?
Yes, but you may consider replacing strncpy with strlcpy:
+		memcpy(dir_buffer, dir, len - suffix_len);
+		dir_buffer[len - suffix_len] = '\0';
strlcpy(dir_buffer, dir, len - suffix_len + 1);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help