diff options
author | Kent Boortz <kent.boortz@oracle.com> | 2011-07-03 17:47:37 +0200 |
---|---|---|
committer | Kent Boortz <kent.boortz@oracle.com> | 2011-07-03 17:47:37 +0200 |
commit | b6e6097c95eee4f453c117c298ee6a03fdcd499d (patch) | |
tree | 448d397ed328f719a29a8fbbd54df8d943ed7274 /strings | |
parent | 1400d7a2cc33fd158efcb3bd638c4ee4c8762207 (diff) | |
parent | 8e14d52610d747977bcbe2875cbe7d93724d8143 (diff) | |
download | mariadb-git-b6e6097c95eee4f453c117c298ee6a03fdcd499d.tar.gz |
Updated/added copyright headers
Diffstat (limited to 'strings')
-rw-r--r-- | strings/decimal.c | 5 | ||||
-rw-r--r-- | strings/xml.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/strings/decimal.c b/strings/decimal.c index 944954f00f5..43957c7dc19 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -321,8 +321,8 @@ int decimal_actual_fraction(decimal_t *from) from - value to convert to - points to buffer where string representation should be stored - *to_len - in: size of to buffer - out: length of the actually written string + *to_len - in: size of to buffer (incl. terminating '\0') + out: length of the actually written string (excl. '\0') fixed_precision - 0 if representation can be variable length and fixed_decimals will not be checked in this case. Put number as with fixed point position with this @@ -339,6 +339,7 @@ int decimal2string(decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler) { + /* {intg_len, frac_len} output widths; {intg, frac} places in input */ int len, intg, frac= from->frac, i, intg_len, frac_len, fill; /* number digits before decimal point */ int fixed_intg= (fixed_precision ? diff --git a/strings/xml.c b/strings/xml.c index 60753914693..3ad955bbabd 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -166,11 +166,16 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a) } else if ( (p->cur[0] == '"') || (p->cur[0] == '\'') ) { + /* + "string" or 'string' found. + Scan until the closing quote/doublequote, or until the END-OF-INPUT. + */ p->cur++; for (; ( p->cur < p->end ) && (p->cur[0] != a->beg[0]); p->cur++) {} a->end=p->cur; - if (a->beg[0] == p->cur[0])p->cur++; + if (p->cur < p->end) /* Closing quote or doublequote has been found */ + p->cur++; a->beg++; if (!(p->flags & MY_XML_FLAG_SKIP_TEXT_NORMALIZATION)) my_xml_norm_text(a); |