diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/ChangeLog | 10 | ||||
-rw-r--r-- | util/iobuf.c | 33 | ||||
-rw-r--r-- | util/strgutil.c | 12 |
3 files changed, 17 insertions, 38 deletions
diff --git a/util/ChangeLog b/util/ChangeLog index f964bdf33..589eb26c8 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,13 @@ +2001-04-14 Werner Koch <[email protected]> + + * strgutil.c (utf8_to_native): Fixed a segv. Thanks to Keith Clayton. + +2001-04-13 Werner Koch <[email protected]> + + * iobuf.c (iobuf_fopen): Removed because it is not used and + furthermore mode is ignored for an fname of "-". Suggested by + Florian Weimer. + 2001-04-02 Werner Koch <[email protected]> * iobuf.c (translate_file_handle): New. Use this function diff --git a/util/iobuf.c b/util/iobuf.c index 7c0f2d2cc..5013e6039 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -1218,39 +1218,6 @@ iobuf_openrw( const char *fname ) } - -/**************** - * You can overwrite the normal iobuf behaviour by using this function. - * If used the iobuf is a simple wrapper around stdio. - * NULL if an error occures and sets errno - */ -IOBUF -iobuf_fopen( const char *fname, const char *mode ) -{ - IOBUF a; - FILE *fp; - int print_only = 0; - - if( !fname || (*fname=='-' && !fname[1]) ) { - fp = stdin; - #ifdef HAVE_DOSISH_SYSTEM /* We can't use USE_SETMODE here */ - setmode ( fileno(fp) , O_BINARY ); - #endif - fname = "[stdin]"; - print_only = 1; - } - else if( !(fp = fopen(fname, mode) ) ) - return NULL; - a = iobuf_alloc(1, 8192 ); - a->directfp = fp; - a->real_fname = m_strdup( fname ); - - if( DBG_IOBUF ) - log_debug("iobuf_fopen -> %p\n", a->directfp ); - - return a; -} - int iobuf_ioctl ( IOBUF a, int cmd, int intval, void *ptrval ) { diff --git a/util/strgutil.c b/util/strgutil.c index ba92481d5..f65a16167 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -453,11 +453,13 @@ utf8_to_native( const char *string, size_t length ) case '\v': n++; if( p ) *p++ = 'v'; break; case '\b': n++; if( p ) *p++ = 'b'; break; case 0 : n++; if( p ) *p++ = '0'; break; - default: n += 3; - sprintf( p, "x%02x", *s ); - if ( p ) - p += 3; - break; + default: + n += 3; + if ( p ) { + sprintf( p, "x%02x", *s ); + p += 3; + } + break; } } else { |