From 5e443a5d0db8f517582818e756871ec2e8117dbe Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Tue, 14 May 2019 22:01:15 -0700 Subject: Fix two instances of integer-assignment to string. o In cover.cc, the int-result of mkstemps() was assigned to a string and silently interpreted as a single-character filename with a funny value. Fix with the intent: assign the filename. o in libparse.cc, an int was assigned to a string, but depending on visible constructors, this is ambiguous. Explicitly cast this to a char. --- passes/cmds/cover.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'passes/cmds/cover.cc') diff --git a/passes/cmds/cover.cc b/passes/cmds/cover.cc index 0ec747671..721ebded4 100644 --- a/passes/cmds/cover.cc +++ b/passes/cmds/cover.cc @@ -105,7 +105,8 @@ struct CoverPass : public Pass { #else char filename_buffer[4096]; snprintf(filename_buffer, 4096, "%s/yosys_cover_%d_XXXXXX.txt", filename.c_str(), getpid()); - filename = mkstemps(filename_buffer, 4); + mkstemps(filename_buffer, 4); + filename = filename_buffer; #endif } FILE *f = fopen(filename.c_str(), open_mode); -- cgit v1.2.3