diff options
author | Jacques Nadeau <jacques@apache.org> | 2014-08-25 22:30:37 -0700 |
---|---|---|
committer | Jacques Nadeau <jacques@apache.org> | 2014-08-25 22:32:16 -0700 |
commit | 7fc8d6d4dfee9fd37327efa205145e75eaf2cde1 (patch) | |
tree | f2c0f37f288b91eff33b647d3cc80a343d114328 /exec/java-exec/src | |
parent | 91870359947b8457f4613953fe59948fa9f2fe17 (diff) |
Fix initCap function to set outbound position correctly.
Diffstat (limited to 'exec/java-exec/src')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctionHelpers.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctionHelpers.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctionHelpers.java index 68f7ca4ed..d429a2800 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctionHelpers.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctionHelpers.java @@ -32,8 +32,8 @@ public class StringFunctionHelpers { // white space is treated as everything else. public static void initCap(int start, int end, DrillBuf inBuf, DrillBuf outBuf) { boolean capNext = true; - - for (int id = start; id < end; id++) { + int out = 0; + for (int id = start; id < end; id++; out++) { byte currentByte = inBuf.getByte(id); // 'A - Z' : 0x41 - 0x5A @@ -61,7 +61,7 @@ public class StringFunctionHelpers { } } - outBuf.setByte(id, currentByte); + outBuf.setByte(out, currentByte); } // end of for_loop } |