safe STRING_NOTFOUND -> -1 conversion

Change-Id: I1afd5f4ef3b0001e28a6c0ce86f2fe927515fcf4