Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Dec 2004 15:45:22 -0800
From:      Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
To:        Guido Falsi <mad@madpilot.net>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: obexapp-1.4
Message-ID:  <41CDFB92.2070003@savvis.net>
In-Reply-To: <20041224121040.GA55902@wedge.madpilot.net>
References:  <1102668370.34937.7.camel@pav.hide.vol.cz> <41B9E211.8050005@savvis.net> <1102709951.60420.9.camel@hood.oook.cz> <41BA2816.9000908@savvis.net> <1102721530.60420.15.camel@hood.oook.cz> <41BA5490.3000708@savvis.net> <1102731873.60420.21.camel@hood.oook.cz> <41C0C992.2050605@savvis.net> <1103185593.69011.3.camel@pav.hide.vol.cz> <41CB51F5.1060704@savvis.net> <20041224121040.GA55902@wedge.madpilot.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------090407060904050203000304
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello Guido,

> Hello! I'm updating the port for obexapp, and was testing the build on
> an AMD64 machine I recently got an account on. While it builds fine on
> i386, after adding the changes needed for the new iconv dependancy, it's
> generating these warnings on amd64:

[...]

> and the binary seems not to work properly. Unlickyly this machine does
> not have any bluetooth hardware, so my only tedst is launching it and
> checking if the binary reacts properly...if should react like this, if
> i'm right:
> 
> mad@wedge:~ [0]> obexapp
> obexapp: Must specify server BD_ADDR
> 
> BTW I'll file a PR leaving the BREOKEN flag in place for not i386 shortly.

thanks for reporting this. please try the attacted patch. if it works, 
then i will include it in obexapp-1.4.3.

thanks,
max



--------------090407060904050203000304
Content-Type: text/plain;
 name="obexapp.64bit.diff.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="obexapp.64bit.diff.txt"

Index: client.c
===================================================================
RCS file: /usr/local/cvs/ports/obexapp/client.c,v
retrieving revision 1.13
diff -u -r1.13 client.c
--- client.c	23 Dec 2004 23:09:48 -0000	1.13
+++ client.c	25 Dec 2004 21:47:54 -0000
@@ -36,6 +36,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <libgen.h>
 #include <limits.h>
 #include <obex.h>
@@ -745,7 +746,7 @@
 			goto done;
 		}
 
-		syslog(LOG_INFO, "%s(): Putting object %s as %s, size %lld",
+		syslog(LOG_INFO, "%s(): Putting object %s as %s, size %" PRId64,
 			__func__, local, remote, st.st_size);
 
 		hv.bq4 = st.st_size;
Index: server.c
===================================================================
RCS file: /usr/local/cvs/ports/obexapp/server.c,v
retrieving revision 1.6
diff -u -r1.6 server.c
--- server.c	23 Dec 2004 23:09:49 -0000	1.6
+++ server.c	25 Dec 2004 21:48:45 -0000
@@ -37,6 +37,7 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <grp.h>
+#include <inttypes.h>
 #include <limits.h>
 #include <obex.h>
 #include <pwd.h>
@@ -835,7 +836,7 @@
 
 		ls = NULL;
 		asprintf(&ls,
-" <%s name=\"%s\" size=\"%lld\" " \
+" <%s name=\"%s\" size=\"%" PRId64 "\" " \
 "owner=\"%s\" group=\"%s\" " \
 "user-perm=\"%s\" group-perm=\"%s\" other-perm=\"%s\" " \
 "created=\"%04d%02d%02dT%02d%02d%02dZ\" " \
Index: util.c
===================================================================
RCS file: /usr/local/cvs/ports/obexapp/util.c,v
retrieving revision 1.6
diff -u -r1.6 util.c
--- util.c	23 Dec 2004 23:09:49 -0000	1.6
+++ util.c	25 Dec 2004 22:00:43 -0000
@@ -154,8 +154,8 @@
  */
 
 int
-obexapp_util_locale_from_utf8(char const *src, int srclen,
-		char *dst, int dstlen)
+obexapp_util_locale_from_utf8(char const *src, size_t srclen,
+		char *dst, size_t dstlen)
 {
 	char const	*s = src;
 	char		*d = dst;
@@ -186,7 +186,8 @@
  */
 
 int
-obexapp_util_locale_to_utf8(char const *src, int srclen, char *dst, int dstlen)
+obexapp_util_locale_to_utf8(char const *src, size_t srclen,
+		char *dst, size_t dstlen)
 {
 	char const	*s = src;
 	char		*d = dst;
@@ -217,8 +218,8 @@
  */
 
 int
-obexapp_util_locale_from_utf16be(char const *src, int srclen,
-		char *dst, int dstlen)
+obexapp_util_locale_from_utf16be(char const *src, size_t srclen,
+		char *dst, size_t dstlen)
 {
 	char const	*s = src;
 	char		*d = dst;
@@ -242,12 +243,12 @@
 	*d = '\0';
 
 	if (utf16) {
+		if (dstlen == 0)
+			return (-1); /* buffer is too short */
+
 		d ++;
 		dstlen --;
 
-		if (dstlen <= 0)
-			return (-1); /* buffer is too short */
-
 		*d = '\0';
 	}
 
@@ -259,8 +260,8 @@
  */
 
 int
-obexapp_util_locale_to_utf16be(char const *src, int srclen,
-		char *dst, int dstlen)
+obexapp_util_locale_to_utf16be(char const *src, size_t srclen,
+		char *dst, size_t dstlen)
 {
 	char const	*s = src;
 	char		*d = dst;
@@ -282,12 +283,13 @@
 	} while (n > 0);
 
 	*d = '\0';
-	d ++;
-	dstlen --;
 
-	if (dstlen <= 0)
+	if (dstlen == 0)
 		return (-1); /* buffer is too short */
 
+	d ++;
+	dstlen --;
+
 	*d = '\0';
 
 	return (0);
Index: util.h
===================================================================
RCS file: /usr/local/cvs/ports/obexapp/util.h,v
retrieving revision 1.4
diff -u -r1.4 util.h
--- util.h	23 Dec 2004 23:09:49 -0000	1.4
+++ util.h	25 Dec 2004 21:58:43 -0000
@@ -34,10 +34,10 @@
 
 int obexapp_util_locale_init(void);
 void obexapp_util_locale_fini(void);
-int obexapp_util_locale_from_utf8(char const *src, int srclen, char *dst, int dstlen);
-int obexapp_util_locale_to_utf8(char const *src, int srclen, char *dst, int dstlen);
-int obexapp_util_locale_from_utf16be(char const *src, int srclen, char *dst, int dstlen);
-int obexapp_util_locale_to_utf16be(char const *src, int srclen, char *dst, int dstlen);
+int obexapp_util_locale_from_utf8(char const *src, size_t srclen, char *dst, size_t dstlen);
+int obexapp_util_locale_to_utf8(char const *src, size_t srclen, char *dst, size_t dstlen);
+int obexapp_util_locale_from_utf16be(char const *src, size_t srclen, char *dst, size_t dstlen);
+int obexapp_util_locale_to_utf16be(char const *src, size_t srclen, char *dst, size_t dstlen);
 
 int obexapp_util_read(int fd, char *buffer, int buffer_length);
 int obexapp_util_write(int fd, char const *buffer, int buffer_length);

--------------090407060904050203000304--


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41CDFB92.2070003>