use %s then throw the var into atoi(). you won't crash and still it'll be numerical-only.