mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 00:55:11 +01:00
Fix C++ "init-statement in selection" warning
This commit is contained in:
1 parent
e915543f09
commit
255d3a0a29
3 files changed
+6
-3
No files matched your search
@@ -786,7 +786,8 @@ compute_exit_code(std::string status_msg) {
|
|||||||
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
||||||
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
||||||
// linux) for a segmentation fault (e.g. null pointer dereference).
|
// linux) for a segmentation fault (e.g. null pointer dereference).
|
||||||
if (size_t i = status_msg.find('='); i != std::string::npos) {
|
size_t i = status_msg.find('=');
|
||||||
|
if (i != std::string::npos) {
|
||||||
status_msg = status_msg.substr(0, i);
|
status_msg = status_msg.substr(0, i);
|
||||||
}
|
}
|
||||||
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
||||||
|
|||||||
@@ -381,7 +381,8 @@ compute_exit_code(std::string status_msg) {
|
|||||||
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
||||||
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
||||||
// linux) for a segmentation fault (e.g. null pointer dereference).
|
// linux) for a segmentation fault (e.g. null pointer dereference).
|
||||||
if (size_t i = status_msg.find('='); i != std::string::npos) {
|
size_t i = status_msg.find('=');
|
||||||
|
if (i != std::string::npos) {
|
||||||
status_msg = status_msg.substr(0, i);
|
status_msg = status_msg.substr(0, i);
|
||||||
}
|
}
|
||||||
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
||||||
|
|||||||
@@ -593,7 +593,8 @@ compute_exit_code(std::string status_msg) {
|
|||||||
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
// (other non-zero exit codes). Specifically, exit code 2 for internal
|
||||||
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
|
||||||
// linux) for a segmentation fault (e.g. null pointer dereference).
|
// linux) for a segmentation fault (e.g. null pointer dereference).
|
||||||
if (size_t i = status_msg.find('='); i != std::string::npos) {
|
size_t i = status_msg.find('=');
|
||||||
|
if (i != std::string::npos) {
|
||||||
status_msg = status_msg.substr(0, i);
|
status_msg = status_msg.substr(0, i);
|
||||||
}
|
}
|
||||||
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
|
||||||
|
|||||||
Reference in new issue
Block a user