Skip to content

Commit

Permalink
Fixing incorrect return code check
Browse files Browse the repository at this point in the history
  • Loading branch information
gershnik committed Jan 18, 2024
1 parent 3536bec commit f67304e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/objc-helpers/XCTestUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ namespace TestUtil {
va_start(vl, format);
const int ret = vsnprintf(&res[appendPos], appendSize, format, vl);
va_end(vl);
if (ret <= 0)
return ret;
res.resize(appendPos + size_t(ret));
res.resize(appendPos + size_t(ret > 0 ? ret : 0));
return ret;
}

Expand Down

0 comments on commit f67304e

Please sign in to comment.