Re-implement 'getstr'