aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-02-08 11:40:14 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-02-08 11:44:52 -0800
commit265775fc20496ea18d49c42d39fe727b65f78bc4 (patch)
tree21e1e7bd21fec0e29bf86ff03529264da0cedc2a
parentc18f3ed03873a90a0f986f12a84e742c89fc84b0 (diff)
Handle zero-length filenames
-rw-r--r--src/core/lib/profiling/basic_timers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/lib/profiling/basic_timers.c b/src/core/lib/profiling/basic_timers.c
index c4f2772822..1fbc9d7023 100644
--- a/src/core/lib/profiling/basic_timers.c
+++ b/src/core/lib/profiling/basic_timers.c
@@ -90,7 +90,8 @@ static int g_writing_enabled = 1;
static const char *output_filename() {
if (output_filename_or_null == NULL) {
output_filename_or_null = gpr_getenv("LATENCY_TRACE");
- if (output_filename_or_null == NULL) {
+ if (output_filename_or_null == NULL ||
+ strlen(output_filename_or_null) == 0) {
output_filename_or_null = "latency_trace.txt";
}
}