From 18d1ab995f862d1a4b288f2fa7ced723dfcf396c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 21 Aug 2005 18:07:59 +0000 Subject: [PATCH] Single-digit values followed by 's' were not recognized as a valid unit with number. --- src/merge/mkvmerge.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/merge/mkvmerge.cpp b/src/merge/mkvmerge.cpp index 43595eb41..eafbfb86d 100644 --- a/src/merge/mkvmerge.cpp +++ b/src/merge/mkvmerge.cpp @@ -378,7 +378,7 @@ parse_number_with_unit(const string &s, if (display_s == "") display_s = s; - if (s.length() < 3) + if (s.length() < 2) mxerror(_("'%s' is not a valid %s in '%s %s'.\n"), s.c_str(), subject.c_str(), argument.c_str(), display_s.c_str()); @@ -399,6 +399,10 @@ parse_number_with_unit(const string &s, "in '%s %s'.\n"), s.c_str(), argument.c_str(), display_s.c_str()); + if (s.length() < (unit_length + 1)) + mxerror(_("'%s' is not a valid %s in '%s %s'.\n"), + s.c_str(), subject.c_str(), argument.c_str(), display_s.c_str()); + if (!parse_int(s.substr(0, s.length() - unit_length), value)) mxerror(_("'%s' does not contain a valid number in front of the unit in " "'%s %s'.\n"), s.c_str(), argument.c_str(), display_s.c_str());