[gnome-utils] font-viewer: Add missing check
- From: Marek KaÅÃk <mkasik src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-utils] font-viewer: Add missing check
- Date: Wed, 29 Jun 2011 08:24:32 +0000 (UTC)
commit a55cbf45d6addc129bc3d127a6ad0ed75a349b63
Author: Marek Kasik <mkasik redhat com>
Date: Wed Jun 29 10:24:07 2011 +0200
font-viewer: Add missing check
Add missing check and fix return value of vfs_stream_read() (#653571).
font-viewer/ftstream-vfs.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/font-viewer/ftstream-vfs.c b/font-viewer/ftstream-vfs.c
index a433199..deefc54 100644
--- a/font-viewer/ftstream-vfs.c
+++ b/font-viewer/ftstream-vfs.c
@@ -39,8 +39,11 @@ vfs_stream_read (FT_Stream stream,
GFileInputStream *handle = stream->descriptor.pointer;
gssize bytes_read = 0;
+ if (!count && offset > stream->size)
+ return 1;
+
if (!g_seekable_seek (G_SEEKABLE (handle), offset, G_SEEK_SET, NULL, NULL))
- return 0;
+ return (count ? 0 : 1);
if (count > 0) {
bytes_read = g_input_stream_read (G_INPUT_STREAM (handle), buffer,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]