mirror of
https://github.com/MariaDB/server.git
synced 2025-03-28 09:55:34 +01:00
Remove HAVE_SNPRINTF
This fixes up commit 77c184df7c
which explicitly specifies that we use ISO/IEC 9899:1999 (C99),
which includes the snprintf() function.
This commit is contained in:
parent
d1bc469dca
commit
df97eb1432
6 changed files with 1 additions and 19 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011, 2017, MariaDB
|
||||
Copyright (c) 2011, 2022, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -323,11 +323,7 @@ static int write_to_table(char *filename, MYSQL *mysql)
|
|||
{
|
||||
if (verbose)
|
||||
fprintf(stdout, "Deleting the old data from table %s\n", tablename);
|
||||
#ifdef HAVE_SNPRINTF
|
||||
snprintf(sql_statement, FN_REFLEN*16+256, "DELETE FROM %s", tablename);
|
||||
#else
|
||||
sprintf(sql_statement, "DELETE FROM %s", tablename);
|
||||
#endif
|
||||
if (mysql_query(mysql, sql_statement))
|
||||
{
|
||||
db_error_with_table(mysql, tablename);
|
||||
|
|
|
@ -224,7 +224,6 @@
|
|||
#cmakedefine HAVE_SIGWAIT 1
|
||||
#cmakedefine HAVE_SIGWAITINFO 1
|
||||
#cmakedefine HAVE_SLEEP 1
|
||||
#cmakedefine HAVE_SNPRINTF 1
|
||||
#cmakedefine HAVE_STPCPY 1
|
||||
#cmakedefine HAVE_STRERROR 1
|
||||
#cmakedefine HAVE_STRCOLL 1
|
||||
|
|
|
@ -407,7 +407,6 @@ CHECK_FUNCTION_EXISTS (sigwait HAVE_SIGWAIT)
|
|||
CHECK_FUNCTION_EXISTS (sigwaitinfo HAVE_SIGWAITINFO)
|
||||
CHECK_FUNCTION_EXISTS (sigset HAVE_SIGSET)
|
||||
CHECK_FUNCTION_EXISTS (sleep HAVE_SLEEP)
|
||||
CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF)
|
||||
CHECK_FUNCTION_EXISTS (stpcpy HAVE_STPCPY)
|
||||
CHECK_FUNCTION_EXISTS (strcoll HAVE_STRCOLL)
|
||||
CHECK_FUNCTION_EXISTS (strerror HAVE_STRERROR)
|
||||
|
|
|
@ -415,13 +415,9 @@ void field_real::add()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_SNPRINTF
|
||||
buff[sizeof(buff)-1]=0; // Safety
|
||||
snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num);
|
||||
length = (uint) strlen(buff);
|
||||
#else
|
||||
length= snprintf(buff, sizeof(buff), "%-.*f", (int) decs, num);
|
||||
#endif
|
||||
|
||||
// We never need to check further than this
|
||||
end = buff + length - 1 - decs + max_notzero_dec_len;
|
||||
|
|
|
@ -119,11 +119,7 @@ int main(int argc,char *argv[])
|
|||
if (subkeys.i >= 0)
|
||||
weight= subkeys.f;
|
||||
|
||||
#ifdef HAVE_SNPRINTF
|
||||
snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey_buff+1);
|
||||
#else
|
||||
sprintf(buf,"%.*s",(int) keylen,info->lastkey_buff+1);
|
||||
#endif
|
||||
my_casedn_str(default_charset_info,buf);
|
||||
total++;
|
||||
lengths[keylen]++;
|
||||
|
|
|
@ -117,11 +117,7 @@ int main(int argc,char *argv[])
|
|||
if (subkeys.i >= 0)
|
||||
weight= subkeys.f;
|
||||
|
||||
#ifdef HAVE_SNPRINTF
|
||||
snprintf(buf,MAX_LEN,"%.*s",(int) keylen,info->lastkey+1);
|
||||
#else
|
||||
sprintf(buf,"%.*s",(int) keylen,info->lastkey+1);
|
||||
#endif
|
||||
my_casedn_str(default_charset_info,buf);
|
||||
total++;
|
||||
lengths[keylen]++;
|
||||
|
|
Loading…
Add table
Reference in a new issue