• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂bf777b3966985cdb27184df90d175cb5a7a8fedc (tree)
時間2016-01-09 15:30:42
作者Yoshinori Sato <ysato@user...>
CommiterYoshinori Sato

Log Message

use ptsname.

Change Summary

差異

--- a/sim/h8300/io.c
+++ b/sim/h8300/io.c
@@ -7,10 +7,11 @@
77 #include <fcntl.h>
88 #include <sys/time.h>
99 #include <string.h>
10-#define _XOPEN_SOURCE
10+#define __USE_XOPEN
1111 #include <stdlib.h>
1212 #include <sys/socket.h>
1313 #include <netinet/in.h>
14+#include <stdint.h>
1415
1516 #include "sim-main.h"
1617 #undef CSIZE
@@ -977,7 +978,8 @@ static char *openpty(int ch)
977978 if(fd >= 0) {
978979 grantpt(fd);
979980 unlockpt(fd);
980- ptsname_r(fd, ptyname, sizeof(ptyname));
981+ strncpy(ptyname, ptsname(fd), sizeof(ptyname));
982+ ptyname[sizeof(ptyname) - 1] = '\0';
981983 } else {
982984 for(c1='a';c1<='z';c1++)
983985 for(c2=0;c2<sizeof(nm)-1;c2++) {