Commit 147b34e2 authored by serg@serg.mylan's avatar serg@serg.mylan

snprintf compatibility fix

parent 083acc29
...@@ -130,7 +130,11 @@ int main(int argc,char *argv[]) ...@@ -130,7 +130,11 @@ int main(int argc,char *argv[])
#error #error
#endif #endif
#ifdef HAVE_SNPRINTF
snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1); snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1);
#else
sprintf(buf,"%.*s",(int) keylen,info->lastkey+1);
#endif
casedn_str(buf); casedn_str(buf);
total++; total++;
lengths[keylen]++; lengths[keylen]++;
......
...@@ -742,7 +742,7 @@ void Field_decimal::store(double nr) ...@@ -742,7 +742,7 @@ void Field_decimal::store(double nr)
char buff[320]; char buff[320];
fyllchar = zerofill ? (char) '0' : (char) ' '; fyllchar = zerofill ? (char) '0' : (char) ' ';
#ifdef HAVE_SNPRINTF_ #ifdef HAVE_SNPRINTF
buff[sizeof(buff)-1]=0; // Safety buff[sizeof(buff)-1]=0; // Safety
snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr); snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr);
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment