X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Futf8.c;h=8911683485dd0d5fd8bf21fa00315474e294454c;hb=b756b711841bac38e5b69baa51939ca9e1c01adb;hp=bf92cd32a2bff72e763bbb577620ae54ab42d1aa;hpb=96c6e58f286787106e4a7b3bb3900a36051968d6;p=yaz-moved-to-github.git diff --git a/src/utf8.c b/src/utf8.c index bf92cd3..8911683 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ /** @@ -14,7 +14,6 @@ #include #include #include -#include #include "iconv-p.h" @@ -22,7 +21,7 @@ static size_t init_utf8(yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inp, size_t inbytesleft, size_t *no_read) { - if (inp[0] != 0xef) + if (!inp || inp[0] != 0xef) { *no_read = 0; return 0; @@ -245,7 +244,9 @@ yaz_iconv_decoder_t yaz_utf8_decoder(const char *fromcode, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +