aboutsummaryrefslogtreecommitdiffstats
path: root/epan/strutil.c
AgeCommit message (Collapse)AuthorFilesLines
2011-06-16Squelch some compiler warnings.Guy Harris1-4/+6
svn path=/trunk/; revision=37685
2011-04-13Change ws_strdup_escape_underscore() function to be more general, byStephen Fisher1-10/+10
accepting any character as the escaped character. Change existing uses to use '_' for the underscore escaping. svn path=/trunk/; revision=36627
2011-02-18Fix some dead code and zero division issues found by Clang scan-build.Gerald Combs1-13/+6
In convert_string_case() use g_utf8_strup() instead of converting each character by hand. Hopefully this won't cause any unexpected changes in behavior. svn path=/trunk/; revision=36006
2010-12-06Change format_text() and format_text_wsp() to use g_unichar_isprint() forStephen Fisher1-2/+2
UTF-8 support instead of isprint(). This allows the middle packet details pane to display UTF-8 strings instead of escaping them with \xxx notation. svn path=/trunk/; revision=35131
2010-11-04Corrected some pointer types to avoid warnings from clang.Stig Bjørlykke1-2/+2
svn path=/trunk/; revision=34774
2010-08-30Use the top-level isprint.h instead of redefining isprint ourselves.Jeff Morriss1-20/+7
svn path=/trunk/; revision=34016
2010-05-27From Edgar Gladkich:Gerald Combs1-0/+16
This is an extension to the Wireshark context sensitive protocol help. Rows in TreeView window are analyzed and suitable help file (as HTML) is opened in a browser. The help part (large file, 23 MB) of the Protocol Help can be downloaded under www.inacon.com/dowload/stuff/protocol_help.tar.gz This protocol help "light" provides descriptive content for the most frequently used standard protocols, including IP, TCP or SMTP. From me: Changes: Rename "ph_" in some function names to "proto_help_". Move the protocol help code to its own module. Make a bunch of functions static. Remove unused code. Use browser_open_url() instead of a custom function. Increase the logging levels. Don't clobber the normal log handler. Update some Doxygen comments to match the format in the rest of the code base. Removed GTK version checks. We've been 2.x only for a while. Move ph_replace_string to string_replace() in epan/strutil.[ch]. Fix a bunch of memory leaks. Add a NULL pointer check. Reformat the overview menu label. Document the file format and locations. Add Edgar to AUTHORS. svn path=/trunk/; revision=32995
2010-02-23From Jakub Zawadzki:Anders Broman1-43/+0
Optimizations. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303 svn path=/trunk/; revision=31967
2010-01-28Fix various gcc -Wshadow warnings.Bill Meier1-4/+4
svn path=/trunk/; revision=31720
2010-01-26Move underscore escaping/unscaping function to strutil.c;Gerasimos Dimitriadis1-0/+56
Update decoding of IS-801 Request GPS Acquisition Assistance svn path=/trunk/; revision=31685
2009-10-23Move IA5_7BIT_decode to strutil.cAnders Broman1-0/+54
svn path=/trunk/; revision=30669
2009-10-01Remove comment asking if this function should be in strutil.c since it isStephen Fisher1-1/+0
already there. svn path=/trunk/; revision=30225
2009-08-19From Didier Gautheron:Anders Broman1-0/+65
Part 2 Extracted from optimizations patch http://wiki.wireshark.org/Development/Optimization Optimize expert info. Slightly changed by me. svn path=/trunk/; revision=29478
2009-04-08More size_t fixes. Use a string buffer in range.c.Gerald Combs1-1/+1
svn path=/trunk/; revision=27999
2009-03-30Add a couple of size_t casts to packet-dnp.c.Gerald Combs1-2/+2
Make the length arguments of format_text() and format_text_wsp() size_t's, since it's natural to use strlen() for that. svn path=/trunk/; revision=27891
2009-02-17Add a string utility function "string_or_null" which can be used toGerald Combs1-0/+8
guarantee a non-null string value. Use it in the LDAP dissector. Fixes the crash on Windows (and other platforms) reported in bug 3262. svn path=/trunk/; revision=27478
2008-07-12Small whitespace fix.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=25726
2008-05-05Fix a tpyoJörg Mayer1-1/+1
svn path=/trunk/; revision=25227
2008-04-09Remove:Anders Broman1-4/+0
#ifdef NEED_G_ASCII_STRCASECMP_H #include "g_ascii_strcasecmp.h" #endif svn path=/trunk/; revision=24859
2008-04-07- Remove GLIB1 codeStephen Fisher1-94/+0
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION - Remove ws_strsplit files because we no longer need to borrow GLIB2's g_strsplit code for the no longer supported GLIB1 builds svn path=/trunk/; revision=24829
2007-11-27strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delendaGuy Harris1-1/+5
est. Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our own versions if they're missing from GLib (as is the case with GLib 1.x). In the code to build the list of named fields for Diameter, don't use g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping in the hash function and use g_ascii_strcasecmp() in the compare function. We do this because there is no guarantee that toupper(), tolower(), and functions that use them will, for example, map between "I" and "i" in all locales; in Turkish locales, for example, there are, in both upper case and lower case, versions of "i" with and without a dot, and the upper-case version of "i" is "I"-with-a-dot and the lower-case version of "I" is "i"-without-a-dot. This causes strings that should match not to match. This finishes fixing bug 2010 - an earlier checkin prevented the crash (as there are other ways to produce the same crash, e.g. a bogus dictionary.xml file), but didn't fix the case-insensitive string matching. svn path=/trunk/; revision=23623
2007-11-06add a g_byte_array_sized_new() helper if we compile for glib < 2Ronnie Sahlberg1-0/+14
svn path=/trunk/; revision=23373
2007-10-27Apply yet another set of the optimization patches:Anders Broman1-1/+1
- Use a fast path for the most common use of tvb_get_xxx functions: offset is >= 0 and tvb->real_data is set (this one is always true). - match_strval() is a linear search, put the most common protocols TCP/UDP/RDP first. - fix gtk1 g_strlcat declaration Use g_strlcat svn path=/trunk/; revision=23285
2007-10-26Apply yet another set of the optimization patches:Anders Broman1-10/+60
Replace strncpy with g_strlcpy. Add g_strlcat for GTK1 and don't use g_snprintf in GTK1 g_strlcpy printf family is very slow. svn path=/trunk/; revision=23273
2007-07-14Fix yet more casts of ctype.h macro arguments - and fix some cases whereGuy Harris1-7/+7
we were passing an uncasted "char" to those macros. svn path=/trunk/; revision=22306
2007-06-21Be less restrictive about WEP key preferences. Use hex_str_to_bytes toGerald Combs1-4/+4
process WEP keys. Allow the "wep:" prefix for WEP keys even when HAVE_AIRPDCAP isn't defined. Add a NULL pointer check to hex_str_to_bytes(). Fixes bug 1584. Fixup indentation. svn path=/trunk/; revision=22151
2007-05-21make gtk1 compile againRonnie Sahlberg1-1/+2
svn path=/trunk/; revision=21854
2007-04-13Fix some Solaris buildbot warningsStephen Fisher1-3/+3
svn path=/trunk/; revision=21423
2007-02-07From: Gisle VanemLuis Ontanon1-0/+14
The file epan/dissectors/packet-k12.c uses the function strcasestr() which is not available on e.g. Windows. So I cooked up a patch to epan/strutil.c to add epan_strcasestr() (is there a more suited place for such a function?) svn path=/trunk/; revision=20734
2007-02-04From Sebastien Tandel:Stephen Fisher1-1/+2
Steve has modified a while ago hex_str_to_bytes to handle Cisco MAC format (xxxx.xxxx.xxxx). It did not test the nullity of the third and fourth byte (*r, *s) which is however done for the second byte. The test on the second byte is done as well in the following conditional tests. If this test is not mandatory thanks to the return value of isxdigit (at least on GNU/Linux and guess it should be the same on any platform), it would be better to follow the same logic in all tests cases for the comprehension of everyone (... which /could/ even, with luck, be turned in a faster code). Here is a light patch to follow the logic of the conditional tests done in the function. svn path=/trunk/; revision=20714
2007-02-01Allow byte strings (FT_BYTES) to have four digits seperated by - : and .Stephen Fisher1-11/+49
in addition to the currently supported two or one digit at a time. This applies in particular to the FT_ETHER MAC addresses, so that a MAC address can now be entered as xxxx.xxxx.xxxx in addition to the traditional formats. svn path=/trunk/; revision=20660
2007-01-25Fix a key preference crash bug. Improve WPA passphrase and SSID lengthGerald Combs1-1/+0
handling. Free a byte array. Squelch a compiler warning. Fix a URI string parsing bug. svn path=/trunk/; revision=20549
2007-01-15GLib 1.2 doesn't have g_strlcpy(), so don't use it.Gerald Combs1-3/+6
svn path=/trunk/; revision=20438
2007-01-11Fix compilation problems under Windows. In the GTK code, convert SSIDsGerald Combs1-3/+74
to GByteArrays. Add format_uri() to strutil, which formats a byte string with percent-escapes. Fixup whitespace and indentation. svn path=/trunk/; revision=20397
2007-01-11Add uri_str_to_bytes(), byte_array_dup(), and byte_array_equal()Gerald Combs1-0/+86
functions to strutil. Use GByteArrays to store SSIDs for decryption, and let the user specify arbitrary byte strings using percent-encoded strings. We should probably add percent encoding for pass phrases as well, so you can escape the ":" character. Move the key struct key conversion utilities to airpdcap.c, and remove duplicate code from packet-ieee80211.c. Fix a lot of indentation. svn path=/trunk/; revision=20388
2006-10-18In the 802.11 dissector, mark the "wep_keys" preference as obsolete,Gerald Combs1-0/+3
and replace it with an "enable_decryption" preference. Instead of forcing the user to specify how many WEP keys we have, figure it out for ourselves by parsing the key list. When decrypting, don't worry about the key index specified in the header (which resulted in trying to decrypt using the same key twice); simply try each key in order (which we were doing anyway). In hex_str_to_bytes(), handle a null hex string. Update the release notes. svn path=/trunk/; revision=19592
2006-09-22Add support for reading from stdin under Windows. Based on a patch sentGerald Combs1-88/+1
in last year by Gianluca Varenni. Add partial support for reading from named pipes (currently disabled). Move utf_8to16() and utf_16to8() to a separate module (unicode-utils.[ch]) so that we don't have to cut and paste code in dumpcap.c. Fix up whitespace. svn path=/trunk/; revision=19291
2006-06-19New rutine tvb_format_text_wsp() which will change "whiite space" characters ↵Anders Broman1-5/+114
to space before output. svn path=/trunk/; revision=18519
2006-05-28Ethereal->WiresharkAnders Broman1-1/+1
svn path=/trunk/; revision=18234
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-05-18Put a newline at the end of the file.Guy Harris1-1/+1
svn path=/trunk/; revision=18184
2006-04-27Properly grow our buffers for utf_8to16().Gerald Combs1-1/+1
svn path=/trunk/; revision=18017
2006-03-08Use Unicode for all native Win32 calls. Unicode Windows applicationsGerald Combs1-0/+91
use UTF-16 internally and GTK+ 2.x uses UTF-8, which means we have to do a lots of conversions. Add utf_8to16() and utf_16to8 convenience functions to strutil.c. svn path=/trunk/; revision=17534
2006-03-07Remove a case statement which can never be reached, because theGilbert Ramirez1-5/+0
previous isprint() test covers that case. This fixes Coverity bug ID #2. svn path=/trunk/; revision=17507
2006-02-23create a real function to emulate g_strlcat() for GTK<2Ronnie Sahlberg1-0/+14
so that the linker will find it. This eliminates the need to include strutil.h (where this was previously a macro) in all callers of this function. svn path=/trunk/; revision=17392
2005-12-04Squelch a GCC complaint.Guy Harris1-0/+1
svn path=/trunk/; revision=16670
2005-12-02new field type FT_OID for OBJECT IDENTIFIERsTomas Kukosa1-0/+57
svn path=/trunk/; revision=16652
2005-08-17replace some more silly rotating buffers with ep_alloc() callsRonnie Sahlberg1-6/+2
svn path=/trunk/; revision=15386
2004-11-28Change number of bytes displayed in bytes_to_string to 48 to facilitate ↵Anders Broman1-1/+1
display of sha1 digest of 20 bytes. svn path=/trunk/; revision=12612
2004-10-29Have the usual three separate buffers for "format_text()", so that itGuy Harris1-23/+26
can be used multiple times in a single formatting call. svn path=/trunk/; revision=12428