2000-09-01  Ulrich Drepper  <drepper@redhat.com>

	* libio/fmemopen.c (fmemopen_seek): Add default case in switch
	statement.  General cleanup.
This commit is contained in:
Ulrich Drepper 2000-09-01 21:16:28 +00:00
parent 4c7d276eb1
commit c6cc2207a5
4 changed files with 13474 additions and 19 deletions

View File

@ -1,3 +1,8 @@
2000-09-01 Ulrich Drepper <drepper@redhat.com>
* libio/fmemopen.c (fmemopen_seek): Add default case in switch
statement. General cleanup.
2000-08-31 Bruno Haible <haible@clisp.cons.org>
* wctype/wcfuncs.c (iswblank): New function.

View File

@ -93,7 +93,7 @@ fmemopen_read (void *cookie, char *b, size_t s)
c = (fmemopen_cookie_t *) cookie;
if ((c->pos + s) > c->size)
if (c->pos + s > c->size)
{
if (c->pos == c->size)
return -1;
@ -118,11 +118,11 @@ fmemopen_write (void *cookie, const char *b, size_t s)
c = (fmemopen_cookie_t *) cookie;
addnullc = ((s == 0) || (b[s - 1] != '\0')) ? 1 : 0;
addnullc = s == 0 || b[s - 1] != '\0';
if ((c->pos + s + addnullc) > c->size)
if (c->pos + s + addnullc > c->size)
{
if ((c->pos + addnullc) == c->size)
if (c->pos + addnullc == c->size)
return -1;
s = c->size - c->pos - addnullc;
}
@ -151,7 +151,6 @@ fmemopen_seek (void *cookie, _IO_off64_t * p, int w)
switch (w)
{
case SEEK_SET:
np = *p;
break;
@ -164,9 +163,11 @@ fmemopen_seek (void *cookie, _IO_off64_t * p, int w)
np = c->size - *p;
break;
default:
return -1;
}
if ((np < 0) || (np > c->size))
if (np < 0 || np > c->size)
return -1;
c->pos = np;
@ -182,8 +183,7 @@ fmemopen_close (void *cookie)
c = (fmemopen_cookie_t *) cookie;
if (c->mybuffer)
free (c->buffer);
free (c->buffer);
free (c);
return 0;
@ -213,9 +213,7 @@ fmemopen (void *buf, size_t len, const char *mode)
c->buffer[0] = '\0';
}
else
{
c->buffer = buf;
}
c->buffer = buf;
c->size = len;
@ -225,13 +223,9 @@ fmemopen (void *buf, size_t len, const char *mode)
c->maxpos = strlen (c->buffer);
if (mode[0] == 'a')
{
c->pos = c->maxpos;
}
c->pos = c->maxpos;
else
{
c->pos = 0;
}
c->pos = 0;
iof.read = fmemopen_read;
iof.write = fmemopen_write;

View File

@ -1,5 +1,7 @@
2000-09-01 Ulrich Drepper <drepper@redhat.com>
* charmaps/BIG5HKSCS: Add Big5 codes.
* Makefile (test-input): Add sv_SE.ISO-8859-1.
(LOCALES): Likewise.
* sv_SE.ISO-8859-1: New file.

File diff suppressed because it is too large Load Diff