atom: really work with non-NUL-terminated strings

Signed-off-by: Ran Benita <ran234@gmail.com>