diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-01-23 01:45:55 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-01-23 01:45:55 +0000 |
commit | 6dcce1fb9b5b6302e5f062648d6e80fb82d3fe5e (patch) | |
tree | 865354257815cd8c0d72b8ed3c96cdddba02334a /epan/dissectors/packet-aprs.c | |
parent | d4b7cc274273ec84110498744de8b98898e8a1ea (diff) |
Use tvb_get_string_enc() rather than tvb_get_string(). The specs say
ASCII, but there's a proposal to use UTF-8.
svn path=/trunk/; revision=54921
Diffstat (limited to 'epan/dissectors/packet-aprs.c')
-rw-r--r-- | epan/dissectors/packet-aprs.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/epan/dissectors/packet-aprs.c b/epan/dissectors/packet-aprs.c index 1209198d93..5ce0a8b07c 100644 --- a/epan/dissectors/packet-aprs.c +++ b/epan/dissectors/packet-aprs.c @@ -999,8 +999,12 @@ dissect_aprs_weather( tvbuff_t *tvb, /* optional: software type/unit: see if present */ lr = new_offset - offset; #if 0 /* fcn'al change: defer */ + /* + * XXX - ASCII or UTF-8? + * See http://www.aprs.org/aprs12/utf-8.txt + */ if ( ((lr < 3) || (lr > 5)) || - ( lr != strspn( tvb_get_string( wmem_packet_scope(), tvb, offset, lr ), "a-zA-Z0-9-_" ) ) ) + ( lr != strspn( tvb_get_string_enc( wmem_packet_scope(), tvb, offset, lr, ENC_ASCII|ENC_NA ), "a-zA-Z0-9-_" ) ) ) { new_offset = offset; /* Assume rest is a comment: force exit from while */ break; /* from switch */ @@ -1132,7 +1136,11 @@ aprs_item( proto_tree *aprs_tree, tvbuff_t *tvb, int offset ) data_len = 10; - info_buffer = tvb_get_string( wmem_packet_scope(), tvb, offset, data_len ); + /* + * XXX - ASCII or UTF-8? + * See http://www.aprs.org/aprs12/utf-8.txt + */ + info_buffer = tvb_get_string_enc( wmem_packet_scope(), tvb, offset, data_len, ENC_ASCII|ENC_NA ); ch_ptr = strchr( info_buffer, '!' ); if ( ch_ptr != NULL ) |