Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
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
Abuhujair Javed
Postgres FD Implementation
Commits
164442fe
Commit
164442fe
authored
Nov 30, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange code in pg_atoi() to avoid assuming that isspace() cannot
change errno. No reported bugs here, but why take a chance?
parent
bae3fefd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
src/backend/utils/adt/numutils.c
src/backend/utils/adt/numutils.c
+15
-15
No files found.
src/backend/utils/adt/numutils.c
View file @
164442fe
...
@@ -10,13 +10,12 @@
...
@@ -10,13 +10,12 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.
69 2005/10/15 02:49:29 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.
70 2005/11/30 23:10:08 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include "postgres.h"
#include "postgres.h"
#include <errno.h>
#include <math.h>
#include <math.h>
#include <limits.h>
#include <limits.h>
#include <ctype.h>
#include <ctype.h>
...
@@ -84,19 +83,6 @@ pg_atoi(char *s, int size, int c)
...
@@ -84,19 +83,6 @@ pg_atoi(char *s, int size, int c)
errmsg
(
"invalid input syntax for integer:
\"
%s
\"
"
,
errmsg
(
"invalid input syntax for integer:
\"
%s
\"
"
,
s
)));
s
)));
/*
* Skip any trailing whitespace; if anything but whitespace remains before
* the terminating character, bail out
*/
while
(
*
badp
&&
*
badp
!=
c
&&
isspace
((
unsigned
char
)
*
badp
))
badp
++
;
if
(
*
badp
&&
*
badp
!=
c
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for integer:
\"
%s
\"
"
,
s
)));
switch
(
size
)
switch
(
size
)
{
{
case
sizeof
(
int32
):
case
sizeof
(
int32
):
...
@@ -125,6 +111,20 @@ pg_atoi(char *s, int size, int c)
...
@@ -125,6 +111,20 @@ pg_atoi(char *s, int size, int c)
default:
default:
elog
(
ERROR
,
"unsupported result size: %d"
,
size
);
elog
(
ERROR
,
"unsupported result size: %d"
,
size
);
}
}
/*
* Skip any trailing whitespace; if anything but whitespace remains before
* the terminating character, bail out
*/
while
(
*
badp
&&
*
badp
!=
c
&&
isspace
((
unsigned
char
)
*
badp
))
badp
++
;
if
(
*
badp
&&
*
badp
!=
c
)
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_TEXT_REPRESENTATION
),
errmsg
(
"invalid input syntax for integer:
\"
%s
\"
"
,
s
)));
return
(
int32
)
l
;
return
(
int32
)
l
;
}
}
...
...
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