Ver código fonte

Replace with a clearer expression (#728)

xtne6f 6 anos atrás
pai
commit
38fe585a5c
1 arquivos alterados com 6 adições e 3 exclusões
  1. 6 3
      src/civetweb.c

+ 6 - 3
src/civetweb.c

@@ -18960,10 +18960,11 @@ mg_get_system_info(char *buffer, int buflen)
 
 	if ((buffer == NULL) || (buflen < 1)) {
 		buflen = 0;
+		end = buffer;
 	} else {
 		*buffer = 0;
+		end = buffer + buflen;
 	}
-	end = buffer + buflen;
 	if (buflen > (int)(sizeof(eoobj) - 1)) {
 		/* has enough space to append eoobj */
 		append_eoobj = buffer;
@@ -19279,10 +19280,11 @@ mg_get_context_info(const struct mg_context *ctx, char *buffer, int buflen)
 
 	if ((buffer == NULL) || (buflen < 1)) {
 		buflen = 0;
+		end = buffer;
 	} else {
 		*buffer = 0;
+		end = buffer + buflen;
 	}
-	end = buffer + buflen;
 	if (buflen > (int)(sizeof(eoobj) - 1)) {
 		/* has enough space to append eoobj */
 		append_eoobj = buffer;
@@ -19439,10 +19441,11 @@ mg_get_connection_info(const struct mg_context *ctx,
 
 	if ((buffer == NULL) || (buflen < 1)) {
 		buflen = 0;
+		end = buffer;
 	} else {
 		*buffer = 0;
+		end = buffer + buflen;
 	}
-	end = buffer + buflen;
 	if (buflen > (int)(sizeof(eoobj) - 1)) {
 		/* has enough space to append eoobj */
 		append_eoobj = buffer;