[Groonga-commit] groonga/groonga at d3c3082 [master] Fix a bug that url encoding fails if char is unsigned

Back to archive index

susumu.yata null+****@clear*****
Tue Oct 14 11:42:26 JST 2014


susumu.yata	2014-10-14 11:42:26 +0900 (Tue, 14 Oct 2014)

  New Revision: d3c30824830d2f3b616330cf889de494be84b1ca
  https://github.com/groonga/groonga/commit/d3c30824830d2f3b616330cf889de494be84b1ca

  Message:
    Fix a bug that url encoding fails if char is unsigned
    
    GitHub: fixes #217

  Modified files:
    lib/str.c

  Modified: lib/str.c (+1 -1)
===================================================================
--- lib/str.c    2014-10-12 23:31:38 +0900 (255f802)
+++ lib/str.c    2014-10-14 11:42:26 +0900 (29e532a)
@@ -2418,7 +2418,7 @@ grn_text_urlenc(grn_ctx *ctx, grn_obj *buf, const char *s, unsigned int len)
 {
   const char *e, c = '%';
   for (e = s + len; s < e; s++) {
-    if (*s < 0 || urlenc_tbl[(int)*s]) {
+    if ((signed char)*s < 0 || urlenc_tbl[(int)*s]) {
       if (!grn_bulk_write(ctx, buf, &c, 1)) {
         if (grn_text_itoh(ctx, buf, *s, 2)) {
           GRN_BULK_INCR_LEN(buf, -1);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index