X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-tny-stream-gtkhtml.c;h=6303a0f8fe89de131af38c6ec6411155de47a916;hp=b8212bffc9a437e43dd48c872d2c2324c3cafc25;hb=637cd51a023218402fb78a3da497554f9c834464;hpb=63071df3bb59e87da5d50ff0360ec506ac3a2413 diff --git a/src/modest-tny-stream-gtkhtml.c b/src/modest-tny-stream-gtkhtml.c index b8212bf..6303a0f 100644 --- a/src/modest-tny-stream-gtkhtml.c +++ b/src/modest-tny-stream-gtkhtml.c @@ -1,6 +1,34 @@ -/* modest-tny-stream-gtkhtml.c */ +/* Copyright (c) 2006, Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Nokia Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + -/* insert (c)/licensing information) */ +/* modest-tny-stream-gtkhtml.c */ #include "modest-tny-stream-gtkhtml.h" #include @@ -124,7 +152,7 @@ gtkhtml_read (TnyStreamIface *self, char *buffer, size_t n) } -ssize_t +static ssize_t gtkhtml_write (TnyStreamIface *self, const char *buffer, size_t n) { ModestTnyStreamGtkhtmlPrivate *priv; @@ -136,7 +164,7 @@ gtkhtml_write (TnyStreamIface *self, const char *buffer, size_t n) return 0; } - if (n == 0) + if (n == 0 || !buffer) return 0; gtk_html_stream_write (priv->stream, buffer, n);