about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-10-17 05:49:48 +0000
committerRoland McGrath <roland@gnu.org>1995-10-17 05:49:48 +0000
commitb3a59f408e7462fbd77289e8c3f50606044a585a (patch)
treecfd874921dda17cb953c2f4a44b533db0641639d /sysdeps
parent0700dfa143cad61b491c6d596657ee69cd5b35bd (diff)
downloadglibc-b3a59f408e7462fbd77289e8c3f50606044a585a.tar.gz
glibc-b3a59f408e7462fbd77289e8c3f50606044a585a.tar.xz
glibc-b3a59f408e7462fbd77289e8c3f50606044a585a.zip
Tue Oct 17 01:21:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	* stdio-common/psignal.c: Translate signal description strings.
	* string/strsignal.c: Likewise.
	* sysdeps/generic/_strerror.c (_strerror_internal): Translate
	error strings.
	* sysdeps/mach/_strerror.c: Likewise.

	* stdio-common/snprintf.c (__snprintf): Renamed from snprintf;
	call __vsnprintf.
	(snprintf): Define as weak alias.
	* stdio/vsnprintf.c (__vsnprintf): Renamed from vsnprintf.
	(vsnprintf): Define as weak alias.

	* libc-symbols.h [! ASSEMBLER] (_): New macro.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/_strerror.c7
-rw-r--r--sysdeps/mach/_strerror.c13
2 files changed, 10 insertions, 10 deletions
diff --git a/sysdeps/generic/_strerror.c b/sysdeps/generic/_strerror.c
index 0d069f84c5..72ebb216bf 100644
--- a/sysdeps/generic/_strerror.c
+++ b/sysdeps/generic/_strerror.c
@@ -33,13 +33,12 @@ _strerror_internal (errnum, buf, buflen)
 {
   if (errnum < 0 || errnum > _sys_nerr)
     {
-      static char fmt[] = "Unknown error %d";
-      size_t len = snprintf (buf, buflen, fmt, errnum);
-      if (len < sizeof (fmt) - 2)
+      int len = __snprintf (buf, buflen, _("Unknown error %d"), errnum);
+      if (len < 0)
 	return NULL;
       buf[len - 1] = '\0';
       return buf;
     }
 
-  return (char *) _sys_errlist[errnum];
+  return (char *) _(_sys_errlist[errnum]);
 }
diff --git a/sysdeps/mach/_strerror.c b/sysdeps/mach/_strerror.c
index f2411122ea..8754f4c047 100644
--- a/sysdeps/mach/_strerror.c
+++ b/sysdeps/mach/_strerror.c
@@ -40,12 +40,12 @@ _strerror_internal (int errnum, char *buf, size_t buflen)
 
   if (system > err_max_system || ! __mach_error_systems[system].bad_sub)
     {
-      static const char unk[] = "Error in unknown error system: ";
+      const char *unk = _("Error in unknown error system: ");
+      const size_t unklen = strlen (unk);
       char *p = buf + buflen;
       *p-- = '\0';
       p = _itoa (errnum, p, 16, 1);
-      p -= sizeof unk - 1;
-      return memcpy (p, unk, sizeof unk - 1);
+      return memcpy (p - unklen, unk, unklen);
     }
 
   es = &__mach_error_systems[system];
@@ -55,15 +55,16 @@ _strerror_internal (int errnum, char *buf, size_t buflen)
 
   if (code >= es->subsystem[sub].max_code)
     {
-      static const char unk[] = "Unknown error ";
+      const char *unk = _("Unknown error ");
+      const size_t unklen = strlen (unk);
       char *p = buf + buflen;
       size_t len = strlen (es->subsystem[sub].subsys_name);
       *p-- = '\0';
       p = _itoa (errnum, p, 16, 1);
       *p-- = ' ';
       p = memcpy (p - len, es->subsystem[sub].subsys_name, len);
-      return memcpy (p - sizeof unk - 1, unk, sizeof unk - 1);
+      return memcpy (p - unklen, unk, unklen);
     }
 
-  return (char *) es->subsystem[sub].codes[code];
+  return (char *) _(es->subsystem[sub].codes[code]);
 }