mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-03 21:01:50 +00:00
udf: Parameterize output length in udf_put_filename
Make the desired output length a parameter rather than have it hard-coded to UDF_NAME_LEN. Although all call sites still have this length the same, this parameterization will make the function more universal and also consistent with udf_get_filename. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
7955118eaf
commit
525e2c56c3
3 changed files with 13 additions and 11 deletions
|
@ -395,22 +395,22 @@ out1:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int udf_put_filename(struct super_block *sb, const uint8_t *sname,
|
||||
uint8_t *dname, int flen)
|
||||
int udf_put_filename(struct super_block *sb, const uint8_t *sname, int slen,
|
||||
uint8_t *dname, int dlen)
|
||||
{
|
||||
struct ustr unifilename;
|
||||
int namelen;
|
||||
|
||||
if (!udf_char_to_ustr(&unifilename, sname, flen))
|
||||
if (!udf_char_to_ustr(&unifilename, sname, slen))
|
||||
return 0;
|
||||
|
||||
if (UDF_QUERY_FLAG(sb, UDF_FLAG_UTF8)) {
|
||||
namelen = udf_UTF8toCS0(dname, &unifilename, UDF_NAME_LEN);
|
||||
namelen = udf_UTF8toCS0(dname, &unifilename, dlen);
|
||||
if (!namelen)
|
||||
return 0;
|
||||
} else if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP)) {
|
||||
namelen = udf_NLStoCS0(UDF_SB(sb)->s_nls_map, dname,
|
||||
&unifilename, UDF_NAME_LEN);
|
||||
&unifilename, dlen);
|
||||
if (!namelen)
|
||||
return 0;
|
||||
} else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue