OSDN Git Service

monitor: Opencode strndupa in print_string
authorSzymon Janc <szymon.janc@tieto.com>
Wed, 31 Jul 2013 08:51:39 +0000 (10:51 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 1 Aug 2013 07:53:16 +0000 (10:53 +0300)
commita79f22a45a65aa4203483e870f69e5a287ac66ec
treecc420d0d933e1883187982743bce367be14161ab
parentfd9dddbfe6c2d7f3728c096ca961742f2e55dcbd
monitor: Opencode strndupa in print_string

Strndupa is GNU extension. print_string is simple and opencoding
strndupa is not a big loss.

This fix linkage error with bionic library which doesn't provide
strndupa.

target Executable: btmon (out/target/product/grouper/obj/EXECUTABLES/
    btmon_intermediates/LINKED/btmon)
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/
    arm-linux-androideabi/4.6.x-google/../../../../
    arm-linux-androideabi/bin/ld: out/target/product/grouper/obj/
    EXECUTABLES/btmon_intermediates/monitor/sdp.o: in function
    print_string:external/bluetooth/bluez/monitor/sdp.c:146: error:
    undefined reference to 'strndupa'
collect2: ld returned 1 exit status
make: *** [out/target/product/grouper/obj/EXECUTABLES/
    btmon_intermediates/LINKED/btmon] Error
monitor/sdp.c