sscanf() not handling %f floats correctly.
On VikingMud, we're running version 1.7.1.
We noticed a rare bug (we rarely use %f in sscanf) where the floating point number isn't picked up.
Example code: void runme(string arg) { string s; int i; float f;
if(!arg) return; //Handling as string sscanf(arg, "%s",s); printf("String: %s\n",s);
//Handling as int sscanf(arg, "%d",i); printf("Int: %d\n",i);
//Handling as float: sscanf(arg,"%f",f); printf("Float: %f\n",f); }
Doing runme("4.3") will return: String: 4.3 Int: 4 Float: 0.000000
This is consistent.
Maybe related to https://github.com/dworkin/dgd/issues/63?
-Geirpg/Moreldir@VikingMud
I can reproduce this when DGD is compiled with -DLARGENUM.
Should be fixed by b380133ea98147dce448fe19fa3b65da89fcc782.
We'll have a look. And yes - we have it compiled with -DLARGENUM
So, I can finally confirm that this solved our issue.