[gimp] initialize length to appease cppcheck
- From: Nils Philippsen <nphilipp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] initialize length to appease cppcheck
- Date: Thu, 28 Nov 2013 16:51:42 +0000 (UTC)
commit 2e6af22686cba732a10dce3a066349083a4f1498
Author: Nils Philippsen <nils redhat com>
Date: Thu Nov 28 17:43:14 2013 +0100
initialize length to appease cppcheck
The code was technically correct previously: It wrote the uninitialized
length only as a placeholder to overwrite it later on. Yet it's better
to not confuse tools (or people) analysing the code. Besides that having
0 for the length in the file while the payload is being written may aid
debugging e.g. crashes in that code later on.
app/xcf/xcf-save.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c
index 8626238..91b192e 100644
--- a/app/xcf/xcf-save.c
+++ b/app/xcf/xcf-save.c
@@ -1011,7 +1011,7 @@ xcf_save_prop (XcfInfo *info,
if (gimp_parasite_list_persistent_length (list) > 0)
{
- guint32 base, length;
+ guint32 base, length = 0;
long pos;
xcf_write_prop_type_check_error (info, prop_type);
@@ -1056,7 +1056,7 @@ xcf_save_prop (XcfInfo *info,
case PROP_PATHS:
{
- guint32 base, length;
+ guint32 base, length = 0;
glong pos;
xcf_write_prop_type_check_error (info, prop_type);
@@ -1122,7 +1122,7 @@ xcf_save_prop (XcfInfo *info,
case PROP_VECTORS:
{
- guint32 base, length;
+ guint32 base, length = 0;
glong pos;
xcf_write_prop_type_check_error (info, prop_type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]