From 7eb743e88178e98d17f68a5832ec1dfa3e279731 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sun, 12 Jun 2005 18:37:18 +0000 Subject: More codec loader corrections. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6695 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'apps/plugin.c') diff --git a/apps/plugin.c b/apps/plugin.c index 62bc4cfde7..edf32d227d 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -378,14 +378,10 @@ int codec_load_file(const char *plugin, void *parameter) return fd; } - plugin_size = 0; - - do { - rc = read(fd, &pluginbuf[0], PLUGIN_BUFFER_SIZE); - if (rc < 0) - return PLUGIN_ERROR; - plugin_size += rc; - } while (rc > 0) ; + rc = read(fd, &pluginbuf[0], PLUGIN_BUFFER_SIZE); + if (rc <= 0) + return PLUGIN_ERROR; + plugin_size = rc; close(fd); return codec_load_ram(pluginbuf, plugin_size, parameter, NULL, 0); -- cgit v1.2.3