From 02f7fdc85ea8d7f20dd1429589cdc7de6b818780 Mon Sep 17 00:00:00 2001 From: ehouse Date: Fri, 8 Jun 2007 03:15:52 +0000 Subject: [PATCH] fix to build with relay turned on --- palm/connsdlg.c | 17 +++++++++++++++-- palm/palmbt.h | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/palm/connsdlg.c b/palm/connsdlg.c index 5a0c8d415..af2781337 100644 --- a/palm/connsdlg.c +++ b/palm/connsdlg.c @@ -1,4 +1,4 @@ -/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */ +/* -*-mode: C; fill-column: 77; c-basic-offset: 4; compile-command: "make ARCH=ARM_ONLY MEMDEBUG=TRUE"; -*- */ /* * Copyright 2003 by Eric House (xwords@eehouse.org). All rights reserved. * @@ -45,9 +45,22 @@ typedef struct ConnsDlgState { CommsAddrRec* addr; XP_BtAddr btAddr; /* since there's no field, save it here */ XP_BtAddrStr tmp; - char btName[32]; + char btName[PALM_BT_NAME_LEN]; } ConnsDlgState; +static void +strFromField( XP_U16 id, XP_UCHAR* buf, XP_U16 max ) +{ + FieldPtr field = getActiveObjectPtr( id ); + XP_UCHAR* str = FldGetTextPtr( field ); + XP_U16 len = FldGetTextLength( field ); + if ( len > max-1 ) { + len = max - 1; + } + XP_MEMCPY( buf, str, len ); + buf[len] = '\0'; +} /* strFromField */ + static void ctlsFromState( PalmAppGlobals* XP_UNUSED_BT(globals), ConnsDlgState* state ) { diff --git a/palm/palmbt.h b/palm/palmbt.h index 438d29aee..9e296cf83 100644 --- a/palm/palmbt.h +++ b/palm/palmbt.h @@ -25,6 +25,8 @@ #include "comms.h" #include "palmmain.h" +#define PALM_BT_NAME_LEN 48 + /* Needed: feedback to main so status can be posted on the board. Events we * might care about: *