summaryrefslogtreecommitdiff
path: root/nss/lib/freebl/genload.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/lib/freebl/genload.c')
-rw-r--r--nss/lib/freebl/genload.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/nss/lib/freebl/genload.c b/nss/lib/freebl/genload.c
index 63b97db..832deb5 100644
--- a/nss/lib/freebl/genload.c
+++ b/nss/lib/freebl/genload.c
@@ -9,7 +9,7 @@
* const char *NameOfThisSharedLib;
*
* NameOfThisSharedLib:
- * The file name of the shared library that shall be used as the
+ * The file name of the shared library that shall be used as the
* "reference library". The loader will attempt to load the requested
* library from the same directory as the reference library.
*/
@@ -25,13 +25,14 @@
* The caller should call PR_Free to free the string returned by this
* function.
*/
-static char* loader_GetOriginalPathname(const char* link)
+static char*
+loader_GetOriginalPathname(const char* link)
{
#ifdef __GLIBC__
char* tmp = realpath(link, NULL);
char* resolved;
- if (! tmp)
- return NULL;
+ if (!tmp)
+ return NULL;
resolved = PR_Malloc(strlen(tmp) + 1);
strcpy(resolved, tmp); /* This is necessary because PR_Free might not be using free() */
free(tmp);
@@ -58,8 +59,8 @@ static char* loader_GetOriginalPathname(const char* link)
return NULL;
}
strcpy(input, link);
- while ( (iterations++ < BL_MAXSYMLINKS) &&
- ( (retlen = readlink(input, resolved, len - 1)) > 0) ) {
+ while ((iterations++ < BL_MAXSYMLINKS) &&
+ ((retlen = readlink(input, resolved, len - 1)) > 0)) {
char* tmp = input;
resolved[retlen] = '\0'; /* NULL termination */
input = resolved;
@@ -79,11 +80,11 @@ static char* loader_GetOriginalPathname(const char* link)
* Load the library with the file name 'name' residing in the same
* directory as the reference library, whose pathname is 'referencePath'.
*/
-static PRLibrary *
-loader_LoadLibInReferenceDir(const char *referencePath, const char *name)
+static PRLibrary*
+loader_LoadLibInReferenceDir(const char* referencePath, const char* name)
{
- PRLibrary *dlh = NULL;
- char *fullName = NULL;
+ PRLibrary* dlh = NULL;
+ char* fullName = NULL;
char* c;
PRLibSpec libSpec;
@@ -91,12 +92,12 @@ loader_LoadLibInReferenceDir(const char *referencePath, const char *name)
c = strrchr(referencePath, PR_GetDirectorySeparator());
if (c) {
size_t referencePathSize = 1 + c - referencePath;
- fullName = (char*) PORT_Alloc(strlen(name) + referencePathSize + 1);
+ fullName = (char*)PORT_Alloc(strlen(name) + referencePathSize + 1);
if (fullName) {
memcpy(fullName, referencePath, referencePathSize);
- strcpy(fullName + referencePathSize, name);
+ strcpy(fullName + referencePathSize, name);
#ifdef DEBUG_LOADER
- PR_fprintf(PR_STDOUT, "\nAttempting to load fully-qualified %s\n",
+ PR_fprintf(PR_STDOUT, "\nAttempting to load fully-qualified %s\n",
fullName);
#endif
libSpec.type = PR_LibSpec_Pathname;
@@ -109,15 +110,15 @@ loader_LoadLibInReferenceDir(const char *referencePath, const char *name)
}
/*
- * We use PR_GetLibraryFilePathname to get the pathname of the loaded
+ * We use PR_GetLibraryFilePathname to get the pathname of the loaded
* shared lib that contains this function, and then do a PR_LoadLibrary
* with an absolute pathname for the softoken shared library.
*/
-static PRLibrary *
-loader_LoadLibrary(const char *nameToLoad)
+static PRLibrary*
+loader_LoadLibrary(const char* nameToLoad)
{
- PRLibrary *lib = NULL;
+ PRLibrary* lib = NULL;
char* fullPath = NULL;
PRLibSpec libSpec;
@@ -164,4 +165,3 @@ loader_LoadLibrary(const char *nameToLoad)
}
return lib;
}
-