test/common: make sure we a valid str in str_erase
In test_str_erase a buffer (buf[256]
) is filled with random data. Later it is duplicated and then erased via bolt_str_erase
. As a check it is compared to buf
via g_assert_cmpstr
and asserted that they are not equal.
But if by chance buf[0]
is 0
, the string is empty and the check will fail, because there is nothing to erase. Fix that by having the random data prefixed with "bolt", so that there is always a valid string to be erased.
Reported-By: Vladimír Čunát v@cunat.cz
Reported-By: Sebastien Bacher seb128@ubuntu.com
Closes #161 (closed)