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
65a34e93
Commit
65a34e93
authored
Aug 27, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring comments back in sync with code.
parent
73b94657
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
src/backend/utils/adt/numutils.c
src/backend/utils/adt/numutils.c
+15
-5
No files found.
src/backend/utils/adt/numutils.c
View file @
65a34e93
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.5
2 2002/08/27 20:29:10 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.5
3 2002/08/27 20:54:47 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -42,19 +42,29 @@
#define SCHAR_MIN (-SCHAR_MAX-1)
#endif
/*
* pg_atoi: convert string to integer
*
* size is the sizeof() the desired integral result (1, 2, or 4 bytes).
*
* c, if not 0, is the terminator character that may appear after the
* integer. If 0, the string must end after the integer.
*
* Unlike plain atoi(), this will throw elog() upon bad input format or
* overflow.
*/
int32
pg_atoi
(
char
*
s
,
int
size
,
int
c
)
{
long
l
=
0
;
char
*
badp
=
NULL
;
Assert
(
s
);
errno
=
0
;
/*
* Some versions of strtol treat the empty string as an error
. This
*
code will explicitly return 0 for an empty string
.
* Some versions of strtol treat the empty string as an error
, but some
*
seem not to. Make an explicit test to be sure we catch it
.
*/
if
(
s
==
(
char
*
)
NULL
)
...
...
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