Bugzilla bug 131057: define PORT_Strdup as a function that calls PORT_Alloc.

Modified files:
	lib/ckfw/nsprstub.c lib/fortcrypt/swfort/pkcs11/stub.c
	lib/nss/nss.def lib/util/secport.c lib/util/secport.h
This commit is contained in:
wtc%netscape.com 2002-05-01 00:06:39 +00:00
Родитель 48f0f64960
Коммит 10bae1a1e3
5 изменённых файлов: 37 добавлений и 10 удалений

Просмотреть файл

@ -39,7 +39,7 @@
* SW FORTEZZA to link with some low level security functions without dragging
* in NSPR.
*
* $Id: nsprstub.c,v 1.2 2000/09/11 23:27:56 relyea%netscape.com Exp $
* $Id: nsprstub.c,v 1.3 2002/05/01 00:06:29 wtc%netscape.com Exp $
*/
#include "seccomon.h"
@ -200,7 +200,7 @@ PORT_ArenaUnmark(PLArenaPool *arena, void *mark)
}
char *
PORT_ArenaStrdup(PLArenaPool *arena,char *str) {
PORT_ArenaStrdup(PLArenaPool *arena,const char *str) {
int len = PORT_Strlen(str)+1;
char *newstr;

Просмотреть файл

@ -39,7 +39,7 @@
* SW FORTEZZA to link with some low level security functions without dragging
* in NSPR.
*
* $Id: stub.c,v 1.4 2001/09/20 22:07:33 relyea%netscape.com Exp $
* $Id: stub.c,v 1.5 2002/05/01 00:06:33 wtc%netscape.com Exp $
*/
#include "seccomon.h"
@ -115,6 +115,19 @@ PORT_ZFree(void *ptr, size_t len)
}
}
char *
PORT_Strdup(const char *str)
{
size_t len = PORT_Strlen(str)+1;
char *newstr;
newstr = (char *)PORT_Alloc(len);
if (newstr) {
PORT_Memcpy(newstr, str, len);
}
return newstr;
}
void
PORT_SetError(int value)
{
@ -210,7 +223,7 @@ PORT_ArenaUnmark(PLArenaPool *arena, void *mark)
}
char *
PORT_ArenaStrdup(PLArenaPool *arena,char *str) {
PORT_ArenaStrdup(PLArenaPool *arena,const char *str) {
int len = PORT_Strlen(str)+1;
char *newstr;

Просмотреть файл

@ -675,6 +675,7 @@ CERT_FinishExtensions;
CERT_StartCertExtensions;
DER_AsciiToTime;
PK11_ImportCert;
PORT_Strdup;
;+ local:
;+ *;
;+};

Просмотреть файл

@ -38,7 +38,7 @@
*
* NOTE - These are not public interfaces
*
* $Id: secport.c,v 1.13 2002/04/04 00:11:48 nelsonb%netscape.com Exp $
* $Id: secport.c,v 1.14 2002/05/01 00:06:39 wtc%netscape.com Exp $
*/
#include "seccomon.h"
@ -159,6 +159,19 @@ PORT_ZFree(void *ptr, size_t len)
}
}
char *
PORT_Strdup(const char *str)
{
size_t len = PORT_Strlen(str)+1;
char *newstr;
newstr = (char *)PORT_Alloc(len);
if (newstr) {
PORT_Memcpy(newstr, str, len);
}
return newstr;
}
void
PORT_SetError(int value)
{
@ -446,7 +459,7 @@ PORT_ArenaUnmark(PLArenaPool *arena, void *mark)
}
char *
PORT_ArenaStrdup(PLArenaPool *arena, char *str) {
PORT_ArenaStrdup(PLArenaPool *arena, const char *str) {
int len = PORT_Strlen(str)+1;
char *newstr;

Просмотреть файл

@ -38,7 +38,7 @@
*
* NOTE - These are not public interfaces
*
* $Id: secport.h,v 1.5 2002/04/04 00:11:48 nelsonb%netscape.com Exp $
* $Id: secport.h,v 1.6 2002/05/01 00:06:39 wtc%netscape.com Exp $
*/
#ifndef _SECPORT_H_
@ -144,7 +144,7 @@ extern void *PORT_ArenaGrow(PLArenaPool *arena, void *ptr,
extern void *PORT_ArenaMark(PLArenaPool *arena);
extern void PORT_ArenaRelease(PLArenaPool *arena, void *mark);
extern void PORT_ArenaUnmark(PLArenaPool *arena, void *mark);
extern char *PORT_ArenaStrdup(PLArenaPool *arena, char *str);
extern char *PORT_ArenaStrdup(PLArenaPool *arena, const char *str);
#ifdef __cplusplus
}
@ -210,10 +210,10 @@ extern char *PORT_ArenaStrdup(PLArenaPool *arena, char *str);
#define PORT_Strcasecmp PL_strcasecmp
#define PORT_Strcat strcat
#define PORT_Strchr strchr
#define PORT_Strrchr PL_strrchr
#define PORT_Strrchr strrchr
#define PORT_Strcmp strcmp
#define PORT_Strcpy strcpy
#define PORT_Strdup PL_strdup
extern char *PORT_Strdup(const char *s);
#define PORT_Strlen(s) strlen(s)
#define PORT_Strncasecmp PL_strncasecmp
#define PORT_Strncat strncat