Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5da65e92
Commit
5da65e92
authored
Aug 22, 2000
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for snprintf
parent
59e797c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
include/config-win.h
include/config-win.h
+5
-2
sql/field.cc
sql/field.cc
+4
-2
sql/sql_analyse.cc
sql/sql_analyse.cc
+2
-1
sql/sql_string.cc
sql/sql_string.cc
+2
-1
No files found.
include/config-win.h
View file @
5da65e92
...
@@ -222,8 +222,6 @@ inline double ulonglong2double(ulonglong value)
...
@@ -222,8 +222,6 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_PERROR
#define HAVE_PERROR
#define HAVE_VFPRINT
#define HAVE_VFPRINT
#define HAVE_SNPRINTF
#define _snprintf snprintf
#define HAVE_CHSIZE
/* System has chsize() function */
#define HAVE_CHSIZE
/* System has chsize() function */
#define HAVE_RENAME
/* Have rename() as function */
#define HAVE_RENAME
/* Have rename() as function */
#define HAVE_BINARY_STREAMS
/* Have "b" flag in streams */
#define HAVE_BINARY_STREAMS
/* Have "b" flag in streams */
...
@@ -248,6 +246,11 @@ inline double ulonglong2double(ulonglong value)
...
@@ -248,6 +246,11 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_ALLOCA
#define HAVE_ALLOCA
#define HAVE_COMPRESS
#define HAVE_COMPRESS
#ifdef NOT_USED
#define HAVE_SNPRINTF
/* Gave link error */
#define _snprintf snprintf
#endif
#ifdef _MSC_VER
#ifdef _MSC_VER
#define HAVE_LDIV
/* The optimizer breaks in zortech for ldiv */
#define HAVE_LDIV
/* The optimizer breaks in zortech for ldiv */
#define HAVE_ANSI_INCLUDE
#define HAVE_ANSI_INCLUDE
...
...
sql/field.cc
View file @
5da65e92
...
@@ -501,7 +501,8 @@ void Field_decimal::store(double nr)
...
@@ -501,7 +501,8 @@ void Field_decimal::store(double nr)
fyllchar
=
zerofill
?
(
char
)
'0'
:
(
char
)
' '
;
fyllchar
=
zerofill
?
(
char
)
'0'
:
(
char
)
' '
;
#ifdef HAVE_SNPRINTF_
#ifdef HAVE_SNPRINTF_
snprintf
(
buff
,
sizeof
(
buff
),
"%.*f"
,(
int
)
dec
,
nr
);
buff
[
sizeof
(
buff
)
-
1
]
=
0
;
// Safety
snprintf
(
buff
,
sizeof
(
buff
)
-
1
,
"%.*f"
,(
int
)
dec
,
nr
);
#else
#else
sprintf
(
buff
,
"%.*f"
,
dec
,
nr
);
sprintf
(
buff
,
"%.*f"
,
dec
,
nr
);
#endif
#endif
...
@@ -2075,7 +2076,8 @@ String *Field_double::val_str(String *val_buffer,
...
@@ -2075,7 +2076,8 @@ String *Field_double::val_str(String *val_buffer,
*
to
++=
*
pos
++
;
*
to
++=
*
pos
++
;
#else
#else
#ifdef HAVE_SNPRINTF
#ifdef HAVE_SNPRINTF
snprintf
(
to
,
to_length
,
"%.*f"
,
dec
,
nr
);
buff
[
to_length
-
1
]
=
0
;
// Safety
snprintf
(
to
,
to_length
-
1
,
"%.*f"
,
dec
,
nr
);
#else
#else
sprintf
(
to
,
"%.*f"
,
dec
,
nr
);
sprintf
(
to
,
"%.*f"
,
dec
,
nr
);
#endif
#endif
...
...
sql/sql_analyse.cc
View file @
5da65e92
...
@@ -359,7 +359,8 @@ void field_real::add()
...
@@ -359,7 +359,8 @@ void field_real::add()
else
else
{
{
#ifdef HAVE_SNPRINTF
#ifdef HAVE_SNPRINTF
snprintf
(
buff
,
sizeof
(
buff
),
"%-.*f"
,
(
int
)
decs
,
num
);
buff
[
sizeof
(
buff
)
-
1
]
=
0
;
// Safety
snprintf
(
buff
,
sizeof
(
buff
)
-
1
,
"%-.*f"
,
(
int
)
decs
,
num
);
#else
#else
sprintf
(
buff
,
"%-.*f"
,
(
int
)
decs
,
num
);
sprintf
(
buff
,
"%-.*f"
,
(
int
)
decs
,
num
);
#endif
#endif
...
...
sql/sql_string.cc
View file @
5da65e92
...
@@ -186,7 +186,8 @@ bool String::set(double num,uint decimals)
...
@@ -186,7 +186,8 @@ bool String::set(double num,uint decimals)
return
FALSE
;
return
FALSE
;
#else
#else
#ifdef HAVE_SNPRINTF
#ifdef HAVE_SNPRINTF
snprintf
(
buff
,
sizeof
(
buff
),
"%.*f"
,(
int
)
decimals
,
num
);
buff
[
sizeof
(
buff
)
-
1
]
=
0
;
// Safety
snprintf
(
buff
,
sizeof
(
buff
)
-
1
,
"%.*f"
,(
int
)
decimals
,
num
);
#else
#else
sprintf
(
buff
,
"%.*f"
,(
int
)
decimals
,
num
);
sprintf
(
buff
,
"%.*f"
,(
int
)
decimals
,
num
);
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment