[PATCH 1/1] Fix bug in export 64 bit unsigned environment variable.

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

 



(As this is the first patch I'm posting directly to the list rather
than through Sascha, feel free to yell at me if my format is wrong.)

This fixes a fairly major, trivial bug in the export_env_ull function
-- it is currently converting values to signed when it exports them.
As the import function doesn't handle signed values, this means that
any values with the msb set cannot be read back in -- which breaks
some things like passing serial # ATAG's to the kernel.

This simple (one character!) fix solves the problem.

Michael D. Burkey

-------------------------------------------------------------------------

--- a/common/env.c
+++ b/common.env.c
@@ -258,7 +258,7 @@

 void export_env_ull(const char *name, unsigned long long val)
 {
-	char *valstr = asprintf("%lld", val);
+	char *valstr = asprintf("%llu", val);

 	setenv(name, valstr);
 	export(name);

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux