[前][次][番号順一覧][スレッド一覧]

ruby-changes:45063

From: usa <ko1@a...>
Date: Wed, 21 Dec 2016 17:13:47 +0900 (JST)
Subject: [ruby-changes:45063] usa:r57136 (trunk): * win32/win32.c (winnt_stat): use `numberof` macro instead of constant.

usa	2016-12-21 17:13:42 +0900 (Wed, 21 Dec 2016)

  New Revision: 57136

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57136

  Log:
    * win32/win32.c (winnt_stat): use `numberof` macro instead of constant.

  Modified files:
    trunk/win32/win32.c
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 57135)
+++ win32/win32.c	(revision 57136)
@@ -5560,7 +5560,7 @@ winnt_stat(const WCHAR *path, struct sta https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5560
 	}
 	st->st_mode = fileattr_to_unixmode(attr, path);
 	if (len) {
-	    finalname[min(len, PATH_MAX-1)] = L'\0';
+	    finalname[min(len, numberof(finalname)-1)] = L'\0';
 	    path = finalname;
 	    if (wcsncmp(path, namespace_prefix, numberof(namespace_prefix)) == 0)
 		path += numberof(namespace_prefix);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]