From: havoc Date: Tue, 17 Jun 2008 11:13:11 +0000 (+0000) Subject: use %127s in the sscanf X-Git-Tag: xonotic-v0.1.0preview~2206 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1f34fd6d81955ab917855383f6277344bb634ff7;p=xonotic%2Fdarkplaces.git use %127s in the sscanf git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8368 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/r_shadow.c b/r_shadow.c index 5c2acfd7..4864bb86 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -3646,7 +3646,11 @@ void R_Shadow_LoadWorldLights(void) #if _MSC_VER >= 1400 #define sscanf sscanf_s #endif - a = sscanf(t, "%f %f %f %f %f %f %f %d %s %f %f %f %f %f %f %f %f %i", &origin[0], &origin[1], &origin[2], &radius, &color[0], &color[1], &color[2], &style, cubemapname + cubemapname[sizeof(cubemapname)-1] = 0; +#if MAX_QPATH != 128 +#error update this code if MAX_QPATH changes +#endif + a = sscanf(t, "%f %f %f %f %f %f %f %d %127s %f %f %f %f %f %f %f %f %i", &origin[0], &origin[1], &origin[2], &radius, &color[0], &color[1], &color[2], &style, cubemapname #if _MSC_VER >= 1400 , sizeof(cubemapname) #endif