ICU-329 US::extract() takes length, not limit

X-SVN-Rev: 5801
This commit is contained in:
Markus Scherer 2001-09-18 23:52:02 +00:00
parent 250e500aa3
commit 1c6666588c

View File

@ -248,7 +248,7 @@ protected:
int32_t start = (pos <=U_PARSE_CONTEXT_LEN)? 0 : (pos - (U_PARSE_CONTEXT_LEN-1
/* subtract 1 so that we have room for null*/));
int32_t stop = pos;
pattern.extract(start,stop,parseError.preContext,0);
pattern.extract(start,stop-start,parseError.preContext,0);
//null terminate the buffer
parseError.preContext[stop-start] = 0;
@ -256,7 +256,7 @@ protected:
start = pos+1;
stop = ((pos+U_PARSE_CONTEXT_LEN)<=pattern.length()) ? (pos+(U_PARSE_CONTEXT_LEN-1)) :
pattern.length();
pattern.extract(start,stop,parseError.postContext,0);
pattern.extract(start,stop-start,parseError.postContext,0);
//null terminate the buffer
parseError.postContext[stop-start]= 0;
}