about summary refs log tree commit diff
path: root/sysdeps/generic/dl-origin.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/dl-origin.h')
-rw-r--r--sysdeps/generic/dl-origin.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/generic/dl-origin.h b/sysdeps/generic/dl-origin.h
index 6d5a8da52e..495df60296 100644
--- a/sysdeps/generic/dl-origin.h
+++ b/sysdeps/generic/dl-origin.h
@@ -26,7 +26,7 @@ static inline const char *
 get_origin (void)
 {
   char *result = (char *) -1;
-  /* We use te environment variable LD_ORIGIN_PATH.  If it is set make
+  /* We use the environment variable LD_ORIGIN_PATH.  If it is set make
      a copy and strip out trailing slashes.  */
   if (_dl_origin_path != NULL)
     {
@@ -37,7 +37,7 @@ get_origin (void)
       else
 	{
 	  char *cp = __mempcpy (result, _dl_origin_path, len);
-	  while (cp > result && cp[-1] == '/')
+	  while (cp > result + 1 && cp[-1] == '/')
 	    --cp;
 	  *cp = '\0';
 	}