Commit 7c94740b authored by Stefano Sabatini's avatar Stefano Sabatini

ffprobe: in value_string(), do not print trailing space in case of no suffix

parent 15802e78
...@@ -83,9 +83,11 @@ static char *value_string(char *buf, int buf_size, double val, const char *unit) ...@@ -83,9 +83,11 @@ static char *value_string(char *buf, int buf_size, double val, const char *unit)
prefix_string = decimal_unit_prefixes[index]; prefix_string = decimal_unit_prefixes[index];
} }
snprintf(buf, buf_size, "%.3f %s%s", val, prefix_string, show_value_unit ? unit : ""); snprintf(buf, buf_size, "%.3f%s%s%s", val, prefix_string || show_value_unit ? " " : "",
prefix_string, show_value_unit ? unit : "");
} else { } else {
snprintf(buf, buf_size, "%f %s", val, show_value_unit ? unit : ""); snprintf(buf, buf_size, "%f%s%s", val, show_value_unit ? " " : "",
show_value_unit ? unit : "");
} }
return buf; return buf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment