瀏覽代碼

gallium/util: use util_snprintf() in u_socket_connect()

Instead of plain snprintf().  To fix the MSVC build.

snprintf() is used in various places in Mesa/gallium, but apparently,
not in code built with MSVC.

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
tags/18.0-branchpoint
Brian Paul 7 年之前
父節點
當前提交
7a6c6e73a8
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      src/gallium/auxiliary/util/u_network.c

+ 2
- 1
src/gallium/auxiliary/util/u_network.c 查看文件

@@ -2,6 +2,7 @@
#include "pipe/p_compiler.h"
#include "util/u_network.h"
#include "util/u_debug.h"
#include "util/u_string.h"

#include <stdio.h>
#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
@@ -120,7 +121,7 @@ u_socket_connect(const char *hostname, uint16_t port)
hints.ai_family = AF_UNSPEC; // AF_INET or AF_INET6 to force version
hints.ai_socktype = SOCK_STREAM;

snprintf(portString, sizeof(portString), "%d", port);
util_snprintf(portString, sizeof(portString), "%d", port);

r = getaddrinfo(hostname, portString, NULL, &addr);
if (r != 0) {

Loading…
取消
儲存