We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf0d9b1 commit b48b669Copy full SHA for b48b669
proxylab-handout/dstring.c
@@ -1,5 +1,4 @@
1
#include "dstring.h"
2
-#include <math.h>
3
#include <string.h>
4
5
#define DEFAULT_LENGTH 1024
@@ -24,7 +23,9 @@ void string_free(string *pstr)
24
23
*/
25
inline static size_t ceil_divide(size_t a, size_t b)
26
{
27
- return (size_t)(ceil((float)a / (float) b));
+ size_t m = 2;
+ for (m = 2; m * b < a; m+=1) {}
28
+ return m;
29
}
30
31
/* string_append : append cstr to the end of pstr.
proxylab-handout/proxy.c
@@ -49,7 +49,6 @@ void forward_response(int infd, int outfd)
49
string_malloc(&response);
50
51
while (Rio_readlineb(&rio, buf, MAXLINE)) {
52
- printf("%s\n", buf);
53
string_append(&response, buf);
54
55
#ifdef DEBUG
0 commit comments