diff options
Diffstat (limited to 'usr/src/cmd/msgfmt/gnu_handle.c')
-rw-r--r-- | usr/src/cmd/msgfmt/gnu_handle.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/usr/src/cmd/msgfmt/gnu_handle.c b/usr/src/cmd/msgfmt/gnu_handle.c index 7ff40022e8..44f1086702 100644 --- a/usr/src/cmd/msgfmt/gnu_handle.c +++ b/usr/src/cmd/msgfmt/gnu_handle.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -430,11 +429,14 @@ handle_message(struct entry *id, struct entry *str) conv_init(NULL); } else { charset += CHARSET_LEN; - p = charset; - while ((*p != ' ') && (*p != '\t') && - (*p != '\n')) - p++; - len = p - charset; + p = strpbrk(charset, " \t\n"); + if (p != NULL) { + /* p points to a space, tab or new line char */ + len = p - charset; + } else { + /* not found */ + len = strlen(charset); + } tmp = Xmalloc(len + 1); (void) memcpy(tmp, charset, len); *(tmp + len) = '\0'; |