alobbs/libhpack — pull request #34 by Akrog (2014-03-15 11:45:06+00:00)
Title: Fix #33: Libchula buffer escape issues

https://github.com/alobbs/libhpack/issues/33

There were three of Chula's buffer class related QA tests that were
failing.

The issues were origitaded from the right shifting operations inside the
*escape_with_table* fucntion.
Since there is no unsigned right shifting in C and we were working with
signed chars there were potential issues with values ranging from -127
to 0.
In all these cases the issue was with value 0xFF.

To solve this chars were changed to unsigned chars.
It probably was enough changing *s, but I preferred alos changing t,
s_next and end.

The tests that were failing were:

```
buffer_test.c:1127:F:escape_uri:escape_uri:0: Assertion 'b.buf=="%010.0000000.0000000.000000f"' failed: b.buf=="%00%01%1f%7f?", "%010.0000000.0000000.000000f"=="%00%01%1f%7f%ff"
```

```
buffer_test.c:1148:F:escape_uri_delims:escape_uri_delims:0: Assertion 'b.buf=="hola %00%1f %3a0.000000 %5b2170432 %200.0000000.000000f 0x1.4c8e1a8p-1044dios!<>{}-_"' failed: b.buf=="hola%20%00%01%1f%20%3a%3f%23%5b%5d%40%20%7f%ff%20adios!<>{}-_", "hola %00%1f %3a0.000000 %5b 0 %200.0000000.000000f 0x1p-1062dios!<>{}-_"==|"
```

```
buffer_test.c:1169:F:escape_arg:escape_arg:0: Assertion 'b.buf=="hola %00%1f %23 %26 b0.000000 %7f0.000000f 0x1.4c8deb8p-1044dios!@[]<>"' failed: b.buf=="hola%20%00%01%1f%20%23%25%26%2b%3f%20%7f%?f%20adios!@[]<>", "hola %00%1f %23 %26 b0.000000 %7f0.000000f 0x1.4c85d294p-1044dios!@[]<>"=="hola%20%00%01%1f%20%23%25%26%2b%3f%20%7f%ff%20adios!@[]<>"
```