Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3629074d
Commit
3629074d
authored
May 29, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed buffer handling of some locale functions (based on a patch by
Mehmet Yasar).
parent
43b3177e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
ole2nls.c
ole/ole2nls.c
+14
-16
No files found.
ole/ole2nls.c
View file @
3629074d
...
...
@@ -573,8 +573,10 @@ INT WINAPI GetLocaleInfoA(LCID lcid,LCTYPE LCType,LPSTR buf,INT len)
}
/* if len=0 return only the length, don't touch the buffer*/
if
(
len
)
{
lstrcpynA
(
buf
,
retString
,
len
);
return
strlen
(
buf
)
+
1
;
/* Like Windows we copy len bytes to buffer and we check len after */
INT
ret
=
strlen
(
retString
)
+
1
;
memcpy
(
buf
,
retString
,
min
(
len
,
ret
)
);
return
(
len
<
ret
)
?
0
:
ret
;
}
return
strlen
(
retString
)
+
1
;
}
...
...
@@ -3270,15 +3272,12 @@ INT WINAPI GetNumberFormatA(LCID locale, DWORD dwflags,
/* If cchNumber is zero, then returns the number of bytes or characters
* required to hold the formatted number string
*/
if
(
cchNumber
==
0
)
retVal
=
strlen
(
sDestination
)
+
1
;
else
retVal
=
strlen
(
sDestination
)
+
1
;
if
(
cchNumber
!=
0
)
{
strncpy
(
lpNumberStr
,
sDestination
,
cchNumber
-
1
);
*
(
lpNumberStr
+
cchNumber
-
1
)
=
'\0'
;
/* ensure we got a NULL at the end */
retVal
=
strlen
(
lpNumberStr
);
memcpy
(
lpNumberStr
,
sDestination
,
min
(
cchNumber
,
retVal
)
);
if
(
cchNumber
<
retVal
)
retVal
=
0
;
}
return
retVal
;
}
...
...
@@ -3525,15 +3524,14 @@ INT WINAPI GetCurrencyFormatA(LCID locale, DWORD dwflags,
}
}
if
(
cchCurrency
==
0
)
return
strlen
(
pDestination
)
+
1
;
retVal
=
strlen
(
pDestination
)
+
1
;
else
if
(
cchCurrency
)
{
strncpy
(
lpCurrencyStr
,
pDestination
,
cchCurrency
-
1
);
*
(
lpCurrencyStr
+
cchCurrency
-
1
)
=
'\0'
;
/* ensure we got a NULL at the end */
return
strlen
(
lpCurrencyStr
);
}
memcpy
(
lpCurrencyStr
,
pDestination
,
min
(
cchCurrency
,
retVal
)
);
if
(
cchCurrency
<
retVal
)
retVal
=
0
;
}
return
retVal
;
}
/**************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment