فهرست منبع

* bdlib fixes

Bryan Drewery 15 سال پیش
والد
کامیت
19b0e6b299
4فایلهای تغییر یافته به همراه8 افزوده شده و 8 حذف شده
  1. 1 1
      src/EncryptedStream.c
  2. 1 1
      src/crypto/bf_util.c
  3. 1 1
      src/mod/update.mod/update.c
  4. 5 5
      src/net.c

+ 1 - 1
src/EncryptedStream.c

@@ -43,7 +43,7 @@ int EncryptedStream::loadFile (const int fd) {
 
   if (enc_flags & ENC_AES_256_CBC) {
     IV = in_buf(0, 16);
-    in_buf += 16;
+    in_buf += static_cast<size_t>(16);
   }
 
   if (enc_flags & ENC_KEEP_NEWLINES) {

+ 1 - 1
src/crypto/bf_util.c

@@ -93,7 +93,7 @@ bd::String egg_bf_decrypt(bd::String in, const bd::String& key)
 {
   // Skip over '+OK '
   if (in(0, 4) == "+OK ")
-    in += 4;
+    in += static_cast<size_t>(4);
   bd::String out(size_t(in.length() * .9));
   // Too small to process
   if (in.size() < 12) return out;

+ 1 - 1
src/mod/update.mod/update.c

@@ -320,7 +320,7 @@ static void start_sending_binary(int idx, bool streamable)
     dprintf(idx, "sb ls\n");
     bd::String buf;
     while (stream.tell() < stream.length()) {
-      buf = bd::base64Encode(stream.gets(1024));
+      buf = bd::base64Encode(stream.read(1024));
       ulsend(idx, buf.c_str(), buf.length());
     }
     dprintf(idx, "sb le\n");

+ 5 - 5
src/net.c

@@ -1088,9 +1088,9 @@ int sockgets(char *s, int *len)
           // Split off a line
           bd::String line(socklist[i].inbuf->substring(0, newline_index));
           strlcpy(s, line.c_str(), SGRAB + 1);
-          *(socklist[i].inbuf) += int(newline_index) + 1;
+          *(socklist[i].inbuf) += newline_index + 1;
           if (was_crlf)
-           *(socklist[i].inbuf) += 1;
+           *(socklist[i].inbuf) += static_cast<size_t>(1);
 
           if (s[0] && socklist[i].encstatus)
             link_read(i, s, (size_t *) len);
@@ -1113,7 +1113,7 @@ int sockgets(char *s, int *len)
 	  /* Split up into chunks of SGRAB bytes. */
 	  *len = SGRAB;
 	  memcpy(s, socklist[i].inbuf->data(), *len);
-          *(socklist[i].inbuf) += *len;
+          *(socklist[i].inbuf) += static_cast<size_t>(*len);
 	}
 	return socklist[i].sock;
       }
@@ -1167,7 +1167,7 @@ int sockgets(char *s, int *len)
     } else {
       // Take out an SGRAB sized chunk and advance the buffer
       strlcpy(xx, socklist[ret].inbuf->c_str(), SGRAB + 1);
-      *(socklist[ret].inbuf) += SGRAB;
+      *(socklist[ret].inbuf) += static_cast<size_t>(SGRAB);
       /* (leave the rest to be post-pended later) */
     }
   }
@@ -1386,7 +1386,7 @@ void dequeue_sockets()
 	delete socklist[i].outbuf;
 	socklist[i].outbuf = NULL;
       } else if (x > 0) {
-        *(socklist[i].outbuf) += x;
+        *(socklist[i].outbuf) += static_cast<size_t>(x);
       } else {
 	debug3("dequeue_sockets(): errno = %d (%s) on %d", errno, strerror(errno), socklist[i].sock);
       }