From 185b615245113aa26d5fd354dcc00ac777e23029 Mon Sep 17 00:00:00 2001
From: Joerg Wunsch <j@uriah.heep.sax.de>
Date: Mon, 28 Mar 2016 17:29:30 +0000
Subject: [PATCH] bug #47550: Linux GPIO broken * linuxgpio.c: Replace %ud by
 %u in snprintf calls.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1388 81a1dc3b-b13d-400b-aceb-764788c761c2
---
 ChangeLog   | 5 +++++
 NEWS        | 1 +
 linuxgpio.c | 8 ++++----
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f39f04bc..1ef4ff9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-28  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
+
+	bug #47550: Linux GPIO broken
+	* linuxgpio.c: Replace %ud by %u in snprintf calls.
+
 2016-03-02  Joerg Wunsch <j.gnu@uriah.heep.sax.de>
 
 	* usb_hidapi.c (usbhid_recv): Bump read timeout to 300 ms.
diff --git a/NEWS b/NEWS
index be0c9239..532643f2 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ Current:
   * New programmers supported:
 
   * Bugfixes:
+    bug #47550: Linux GPIO broken
 
   * Internals:
 
diff --git a/linuxgpio.c b/linuxgpio.c
index b6181735..b6163117 100644
--- a/linuxgpio.c
+++ b/linuxgpio.c
@@ -66,7 +66,7 @@ static int linuxgpio_export(unsigned int gpio)
     return fd;
   }
 
-  len = snprintf(buf, sizeof(buf), "%ud", gpio);
+  len = snprintf(buf, sizeof(buf), "%u", gpio);
   r = write(fd, buf, len);
   close(fd);
 
@@ -84,7 +84,7 @@ static int linuxgpio_unexport(unsigned int gpio)
     return fd;
   }
 
-  len = snprintf(buf, sizeof(buf), "%ud", gpio);
+  len = snprintf(buf, sizeof(buf), "%u", gpio);
   r = write(fd, buf, len);
   close(fd);
 
@@ -95,7 +95,7 @@ static int linuxgpio_openfd(unsigned int gpio)
 {
   char filepath[60];
 
-  snprintf(filepath, sizeof(filepath), "/sys/class/gpio/gpio%ud/value", gpio);
+  snprintf(filepath, sizeof(filepath), "/sys/class/gpio/gpio%u/value", gpio);
   return (open(filepath, O_RDWR));
 }
 
@@ -104,7 +104,7 @@ static int linuxgpio_dir(unsigned int gpio, unsigned int dir)
   int fd, r;
   char buf[60];
 
-  snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%ud/direction", gpio);
+  snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%u/direction", gpio);
 
   fd = open(buf, O_WRONLY);
   if (fd < 0) {