Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/posix/collate.c')
-rw-r--r--newlib/libc/posix/collate.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/newlib/libc/posix/collate.c b/newlib/libc/posix/collate.c
index 4e717bc39..8af8970c9 100644
--- a/newlib/libc/posix/collate.c
+++ b/newlib/libc/posix/collate.c
@@ -175,14 +175,12 @@ __collate_strdup(s)
void
__collate_err(int ex, const char *f)
{
- const char *s = strdup("collate_error");
+ const char *s;
int serrno = errno;
- write(STDERR_FILENO, s, strlen(s));
- write(STDERR_FILENO, ": ", 2);
- free(s);
- s = f;
- write(STDERR_FILENO, s, strlen(s));
+ /* Be careful to change write counts if you change the strings */
+ write(STDERR_FILENO, "collate_error: ", 15);
+ write(STDERR_FILENO, f, strlen(f));
write(STDERR_FILENO, ": ", 2);
s = strerror(serrno);
write(STDERR_FILENO, s, strlen(s));