Skip to content
Snippets Groups Projects
Commit 0f6a961e authored by Bruce Momjian's avatar Bruce Momjian
Browse files

cleanup of patch

parent edb58721
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.6 1997/08/12 20:15:55 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.7 1997/08/12 20:39:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -101,8 +101,7 @@ char *char16in(char *s) ...@@ -101,8 +101,7 @@ char *char16in(char *s)
if (s == NULL) if (s == NULL)
return(NULL); return(NULL);
result = (char *) palloc(16); result = (char *) palloc(16);
memset(result, 0, 16); strncpy(result, s, 16);
(void) strncpy(result, s, 16);
return(result); return(result);
} }
...@@ -113,12 +112,11 @@ char *char16out(char *s) ...@@ -113,12 +112,11 @@ char *char16out(char *s)
{ {
char *result = (char *) palloc(17); char *result = (char *) palloc(17);
memset(result, 0, 17);
if (s == NULL) { if (s == NULL) {
result[0] = '-'; result[0] = '-';
} else { result[1] = '\0';
strncpy(result, s, 16); } else
} strNcpy(result, s, 16);
return(result); return(result);
} }
...@@ -207,8 +205,7 @@ uint16 char2in(char *s) ...@@ -207,8 +205,7 @@ uint16 char2in(char *s)
if (s == NULL) if (s == NULL)
return(0); return(0);
memset((char *) &res, 0, sizeof(res)); strncpy((char *) &res, s, 2);
(void) strncpy((char *) &res, s, 2);
return(res); return(res);
} }
...@@ -216,8 +213,7 @@ char *char2out(uint16 s) ...@@ -216,8 +213,7 @@ char *char2out(uint16 s)
{ {
char *result = (char *) palloc(3); char *result = (char *) palloc(3);
memset(result, 0, 3); strNcpy(result, (char *) &s, 2);
(void) strncpy(result, (char *) &s, 2);
return(result); return(result);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment