use snprintf rather than sprintf

safe buffering