summary refs log tree commit diff
path: root/usage.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-30 21:51:27 +0900
committerJunio C Hamano <gitster@pobox.com>2018-05-30 21:51:28 +0900
commit7c3d15fe3113cf48db60656eedd152c46f47bf6b (patch)
treeafcbf8eb2ae30d903c3649aab8093a8c3a8f4b82 /usage.c
parentb2fd6592943db80ef9bfccbf55d65a39268d76ed (diff)
parentac4896f007a624c12feda866aeb4abe8a1394e39 (diff)
Merge branch 'jk/snprintf-truncation'
Avoid unchecked snprintf() to make future code auditing easier.

* jk/snprintf-truncation:
  fmt_with_err: add a comment that truncation is OK
  shorten_unambiguous_ref: use xsnprintf
  fsmonitor: use internal argv_array of struct child_process
  log_write_email_headers: use strbufs
  http: use strbufs instead of fixed buffers
Diffstat (limited to 'usage.c')
-rw-r--r--usage.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usage.c b/usage.c
index 9c84dccfa9..cc803336bd 100644
--- a/usage.c
+++ b/usage.c
@@ -148,6 +148,7 @@ static const char *fmt_with_err(char *buf, int n, const char *fmt)
 		}
 	}
 	str_error[j] = 0;
+	/* Truncation is acceptable here */
 	snprintf(buf, n, "%s: %s", fmt, str_error);
 	return buf;
 }