|
1 | 1 | /* ----------------------------------------------------------------------- |
2 | 2 | * formatting.c |
3 | 3 | * |
4 | | - * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.149 2008/10/06 05:03:27 tgl Exp $ |
| 4 | + * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.150 2008/11/10 17:36:53 heikki Exp $ |
5 | 5 | * |
6 | 6 | * |
7 | 7 | * Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group |
@@ -1771,7 +1771,7 @@ from_char_set_int(int *dest, const int value, const FormatNode *node) |
1771 | 1771 |
|
1772 | 1772 | /* |
1773 | 1773 | * Read a single integer from the source string, into the int pointed to by |
1774 | | - * 'dest'. |
| 1774 | + * 'dest'. If 'dest' is NULL, the result is discarded. |
1775 | 1775 | * |
1776 | 1776 | * In fixed-width mode (the node does not have the FM suffix), consume at most |
1777 | 1777 | * 'len' characters. |
@@ -1862,7 +1862,8 @@ from_char_parse_int_len(int *dest, char **src, const int len, FormatNode *node) |
1862 | 1862 | errdetail("Value must be in the range %d to %d.", |
1863 | 1863 | INT_MIN,INT_MAX))); |
1864 | 1864 |
|
1865 | | -from_char_set_int(dest, (int)result,node); |
| 1865 | +if (dest!=NULL) |
| 1866 | +from_char_set_int(dest, (int)result,node); |
1866 | 1867 | return*src-init; |
1867 | 1868 | } |
1868 | 1869 |
|
|