[nautilus-actions] Fix default int value when reading null string



commit 1cf01b210ab05a03328602f94f6f202108df726e
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Aug 18 15:07:48 2010 +0200

    Fix default int value when reading null string

 ChangeLog                |    3 +++
 src/core/na-data-boxed.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fd6377a..99f48db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-08-18 Pierre Wieser <pwieser trychlos org>
 
+	* src/core/na-data-boxed.c (uint_set_from_string):
+	Fix default uint value when reading null string.
+
 	* src/nact/nact-assistant-import.c (assistant_apply): Cleanup code.
 
 2010-08-17 Pierre Wieser <pwieser trychlos org>
diff --git a/src/core/na-data-boxed.c b/src/core/na-data-boxed.c
index 80c5469..ee70308 100644
--- a/src/core/na-data-boxed.c
+++ b/src/core/na-data-boxed.c
@@ -1417,7 +1417,7 @@ uint_set_from_boxed( NADataBoxed *boxed, const NADataBoxed *source )
 static void
 uint_set_from_string( NADataBoxed *boxed, const gchar *string )
 {
-	boxed->private->u.uint = atoi( string );
+	boxed->private->u.uint = string ? atoi( string ) : 0;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]