about summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/ctermid.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sysdeps/posix/ctermid.c b/sysdeps/posix/ctermid.c
index 410e3ece44..ea1f9a098e 100644
--- a/sysdeps/posix/ctermid.c
+++ b/sysdeps/posix/ctermid.c
@@ -29,11 +29,8 @@ ctermid (s)
 {
   static char name[L_ctermid];
 
-  if (name[0] == '\0')
-    (void) strcpy(name, "/dev/tty");
-
   if (s == NULL)
-    return(name);
+    s = name;
 
-  return(strcpy(s, name));
+  return strcpy (s, "/dev/tty");
 }