Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
eb95e6fb
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
eb95e6fb
编写于
9月 12, 2013
作者:
B
bagiras
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7064312: Cleanup: avoid using unsafe string function
Reviewed-by: serb, pchelko
上级
362a5308
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
25 deletion
+14
-25
src/windows/native/sun/windows/awt_FileDialog.cpp
src/windows/native/sun/windows/awt_FileDialog.cpp
+3
-3
src/windows/native/sun/windows/awt_Font.cpp
src/windows/native/sun/windows/awt_Font.cpp
+1
-12
src/windows/native/sun/windows/awt_PrintControl.cpp
src/windows/native/sun/windows/awt_PrintControl.cpp
+4
-4
src/windows/native/sun/windows/awt_Toolkit.cpp
src/windows/native/sun/windows/awt_Toolkit.cpp
+1
-1
src/windows/native/sun/windows/awt_TrayIcon.cpp
src/windows/native/sun/windows/awt_TrayIcon.cpp
+4
-4
src/windows/native/sun/windows/awt_ole.cpp
src/windows/native/sun/windows/awt_ole.cpp
+1
-1
未找到文件。
src/windows/native/sun/windows/awt_FileDialog.cpp
浏览文件 @
eb95e6fb
/*
* Copyright (c) 1996, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -73,7 +73,7 @@ AwtFileDialog::Initialize(JNIEnv *env, jstring filterDescription)
int
length
=
env
->
GetStringLength
(
filterDescription
);
DASSERT
(
length
+
1
<
MAX_FILTER_STRING
);
LPCTSTR
tmp
=
JNU_GetStringPlatformChars
(
env
,
filterDescription
,
NULL
);
_tcscpy
(
s_fileFilterString
,
tmp
);
_tcscpy
_s
(
s_fileFilterString
,
MAX_FILTER_STRING
,
tmp
);
JNU_ReleaseStringPlatformChars
(
env
,
filterDescription
,
tmp
);
//AdditionalString should be terminated by two NULL characters (Windows
...
...
@@ -353,7 +353,7 @@ AwtFileDialog::Show(void *p)
if
(
!
result
)
{
dlgerr
=
::
CommDlgExtendedError
();
if
(
dlgerr
==
FNERR_INVALIDFILENAME
)
{
_tcscpy
(
fileBuffer
,
TEXT
(
""
));
_tcscpy
_s
(
fileBuffer
,
bufferLimit
,
TEXT
(
""
));
if
(
mode
==
java_awt_FileDialog_LOAD
)
{
result
=
AwtFileDialog
::
GetOpenFileName
(
&
ofn
);
}
else
{
...
...
src/windows/native/sun/windows/awt_Font.cpp
浏览文件 @
eb95e6fb
/*
* Copyright (c) 1996, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -366,17 +366,6 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale)
return
awtFont
;
}
int
CALLBACK
FindFamilyName
(
ENUMLOGFONTEX
*
lpelfe
,
NEWTEXTMETRICEX
*
lpntme
,
int
FontType
,
LPARAM
lParam
)
{
if
(
_tcsstr
((
LPTSTR
)
lParam
,
lpelfe
->
elfLogFont
.
lfFaceName
))
{
_tcscpy
((
LPTSTR
)
lParam
,
lpelfe
->
elfLogFont
.
lfFaceName
);
return
0
;
}
else
{
return
1
;
}
}
static
void
strip_tail
(
wchar_t
*
text
,
wchar_t
*
tail
)
{
// strips tail and any possible whitespace before it from the end of text
if
(
wcslen
(
text
)
<=
wcslen
(
tail
))
{
return
;
...
...
src/windows/native/sun/windows/awt_PrintControl.cpp
浏览文件 @
eb95e6fb
/*
* Copyright (c) 1999, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -422,17 +422,17 @@ BOOL AwtPrintControl::CreateDevModeAndDevNames(PRINTDLG *ppd,
devnames
->
wOutputOffset
=
static_cast
<
WORD
>
(
sizeof
(
DEVNAMES
)
/
sizeof
(
TCHAR
)
+
lenDriverName
+
lenPrinterName
);
if
(
info2
->
pDriverName
!=
NULL
)
{
_tcscpy
(
lpcDevnames
+
devnames
->
wDriverOffset
,
info2
->
pDriverName
);
_tcscpy
_s
(
lpcDevnames
+
devnames
->
wDriverOffset
,
devnameSize
-
devnames
->
wDriverOffset
,
info2
->
pDriverName
);
}
else
{
*
(
lpcDevnames
+
devnames
->
wDriverOffset
)
=
_T
(
'\0'
);
}
if
(
pPrinterName
!=
NULL
)
{
_tcscpy
(
lpcDevnames
+
devnames
->
wDeviceOffset
,
pPrinterName
);
_tcscpy
_s
(
lpcDevnames
+
devnames
->
wDeviceOffset
,
devnameSize
-
devnames
->
wDeviceOffset
,
pPrinterName
);
}
else
{
*
(
lpcDevnames
+
devnames
->
wDeviceOffset
)
=
_T
(
'\0'
);
}
if
(
info2
->
pPortName
!=
NULL
)
{
_tcscpy
(
lpcDevnames
+
devnames
->
wOutputOffset
,
info2
->
pPortName
);
_tcscpy
_s
(
lpcDevnames
+
devnames
->
wOutputOffset
,
devnameSize
-
devnames
->
wOutputOffset
,
info2
->
pPortName
);
}
else
{
*
(
lpcDevnames
+
devnames
->
wOutputOffset
)
=
_T
(
'\0'
);
}
...
...
src/windows/native/sun/windows/awt_Toolkit.cpp
浏览文件 @
eb95e6fb
...
...
@@ -228,7 +228,7 @@ BOOL AwtToolkit::activateKeyboardLayout(HKL hkl) {
// create input locale string, e.g., "00000409", from hkl.
TCHAR
inputLocale
[
9
];
TCHAR
buf
[
9
];
_tcscpy
(
inputLocale
,
TEXT
(
"00000000"
));
_tcscpy
_s
(
inputLocale
,
9
,
TEXT
(
"00000000"
));
// 64-bit: ::LoadKeyboardLayout() is such a weird API - a string of
// the hex value you want?! Here we're converting our HKL value to
...
...
src/windows/native/sun/windows/awt_TrayIcon.cpp
浏览文件 @
eb95e6fb
/*
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -711,7 +711,7 @@ void AwtTrayIcon::SetToolTip(LPCTSTR tooltip)
_tcsncpy
(
m_nid
.
szTip
,
tooltip
,
TRAY_ICON_TOOLTIP_MAX_SIZE
);
m_nid
.
szTip
[
TRAY_ICON_TOOLTIP_MAX_SIZE
-
1
]
=
'\0'
;
}
else
{
_tcscpy
(
m_nid
.
szTip
,
tooltip
);
_tcscpy
_s
(
m_nid
.
szTip
,
TRAY_ICON_TOOLTIP_MAX_SIZE
,
tooltip
);
}
SendTrayMessage
(
NIM_MODIFY
);
...
...
@@ -817,7 +817,7 @@ void AwtTrayIcon::DisplayMessage(LPCTSTR caption, LPCTSTR text, LPCTSTR msgType)
m_nid
.
szInfoTitle
[
TRAY_ICON_BALLOON_TITLE_MAX_SIZE
-
1
]
=
'\0'
;
}
else
{
_tcscpy
(
m_nid
.
szInfoTitle
,
caption
);
_tcscpy
_s
(
m_nid
.
szInfoTitle
,
TRAY_ICON_BALLOON_TITLE_MAX_SIZE
,
caption
);
}
if
(
text
[
0
]
==
'\0'
)
{
...
...
@@ -830,7 +830,7 @@ void AwtTrayIcon::DisplayMessage(LPCTSTR caption, LPCTSTR text, LPCTSTR msgType)
m_nid
.
szInfo
[
TRAY_ICON_BALLOON_INFO_MAX_SIZE
-
1
]
=
'\0'
;
}
else
{
_tcscpy
(
m_nid
.
szInfo
,
text
);
_tcscpy
_s
(
m_nid
.
szInfo
,
TRAY_ICON_BALLOON_INFO_MAX_SIZE
,
text
);
}
SendTrayMessage
(
NIM_MODIFY
);
...
...
src/windows/native/sun/windows/awt_ole.cpp
浏览文件 @
eb95e6fb
...
...
@@ -70,7 +70,7 @@ namespace SUN_DBG_NS{
bErrorReport
?
_T
(
"Error:"
)
:
_T
(
""
),
szBuffer
)
<
0
)
{
_tcscpy
(
szBuffer1
+
DTRACE_BUF_LEN
-
5
,
_T
(
"..."
));
//reserver for \n
_tcscpy
_s
(
szBuffer1
+
DTRACE_BUF_LEN
-
5
,
5
,
_T
(
"..."
));
//reserver for \n
}
memcpy
(
szBuffer1
,
szTime
,
iTimeLen
*
sizeof
(
TCHAR
));
_tcscat
(
szBuffer1
,
_T
(
"
\n
"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录