From owner-freebsd-bluetooth@FreeBSD.ORG Sat Dec 25 23:46:29 2004 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 876E516A4D1 for ; Sat, 25 Dec 2004 23:46:29 +0000 (GMT) Received: from mailgate1b.savvis.net (mailgate1b.savvis.net [216.91.182.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DADF43D41 for ; Sat, 25 Dec 2004 23:46:29 +0000 (GMT) (envelope-from Maksim.Yevmenkin@savvis.net) Received: from out001.email.savvis.net (out001.apptix.savvis.net [216.91.32.44])iBPNjsJa019610; Sat, 25 Dec 2004 17:45:54 -0600 Received: from s228130hz1ew17.apptix-01.savvis.net ([10.146.4.29]) by out001.email.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Sat, 25 Dec 2004 17:45:43 -0600 Received: from [192.168.1.245] ([70.32.233.78]) by s228130hz1ew17.apptix-01.savvis.net with Microsoft SMTPSVC(6.0.3790.211); Sat, 25 Dec 2004 17:45:45 -0600 Message-ID: <41CDFB92.2070003@savvis.net> Date: Sat, 25 Dec 2004 15:45:22 -0800 From: Maksim Yevmenkin User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040822 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Guido Falsi 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> In-Reply-To: <20041224121040.GA55902@wedge.madpilot.net> Content-Type: multipart/mixed; boundary="------------090407060904050203000304" X-OriginalArrivalTime: 25 Dec 2004 23:45:45.0173 (UTC) FILETIME=[DA23C050:01C4EADB] X-ECS-MailScanner: No virus is found cc: freebsd-bluetooth@freebsd.org Subject: Re: obexapp-1.4 X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Dec 2004 23:46:29 -0000 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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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--