mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Michael D. Burkey" <mdburkey@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/1] Fix bug in export 64 bit unsigned environment variable.
Date: Thu, 10 Apr 2014 16:16:03 -0400	[thread overview]
Message-ID: <CAO6XYUtP6uWHoc4GBD9ixt+s-nNJqb12CFRD10aqhiCi+c+Lmw@mail.gmail.com> (raw)

(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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2014-04-10 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 20:16 Michael D. Burkey [this message]
2014-04-29 19:16 Michael D. Burkey
2014-04-30  6:56 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO6XYUtP6uWHoc4GBD9ixt+s-nNJqb12CFRD10aqhiCi+c+Lmw@mail.gmail.com \
    --to=mdburkey@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox