diff --git a/repos/base/include/util/string.h b/repos/base/include/util/string.h index 5e41b53d76..eb852fa0f0 100644 --- a/repos/base/include/util/string.h +++ b/repos/base/include/util/string.h @@ -552,7 +552,7 @@ class Genode::Cstring * null once we reach 'max_len'. */ size_t res = 0; - for (; str && *str && res < max_len; str++, res++); + for (; res < max_len && str && *str; str++, res++); return res; }