summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2010-04-22 13:16:18 +0000
committeravg <avg@FreeBSD.org>2010-04-22 13:16:18 +0000
commitfbdaed42d025dfa775c4ae196d05fa5e8fcdbef0 (patch)
tree43aceeae293e18d88890aa7d32d2a8b1cbab1689 /usr.bin
parentd5cc2b016139780c0e8bdb7c9a8829c2236a597b (diff)
downloadFreeBSD-src-fbdaed42d025dfa775c4ae196d05fa5e8fcdbef0.zip
FreeBSD-src-fbdaed42d025dfa775c4ae196d05fa5e8fcdbef0.tar.gz
MFC r206687: indent(1): don't treat bare '_t' as a type name with -ta
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/indent/lexi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c
index 3d415d0..b3604c6 100644
--- a/usr.bin/indent/lexi.c
+++ b/usr.bin/indent/lexi.c
@@ -251,9 +251,10 @@ lexi(void)
if (auto_typedefs) {
const char *q = s_token;
+ size_t q_len = strlen(q);
/* Check if we have an "_t" in the end */
- if (q[0] && q[1] &&
- (strcmp(q + strlen(q) - 2, "_t") == 0)) {
+ if (q_len > 2 &&
+ (strcmp(q + q_len - 2, "_t") == 0)) {
ps.its_a_keyword = true;
ps.last_u_d = true;
goto found_auto_typedef;
OpenPOWER on IntegriCloud