Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4676fc94
Commit
4676fc94
authored
Sep 29, 2005
by
osku@127.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge 127.(none):/home/osku/mysql/5.0/clean
into 127.(none):/home/osku/mysql/5.0/revcpy
parents
3ae0c860
ad524367
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
4 deletions
+38
-4
innobase/include/ut0mem.h
innobase/include/ut0mem.h
+13
-0
innobase/mem/mem0mem.c
innobase/mem/mem0mem.c
+1
-3
innobase/ut/ut0mem.c
innobase/ut/ut0mem.c
+24
-1
No files found.
innobase/include/ut0mem.h
View file @
4676fc94
...
@@ -122,6 +122,7 @@ ut_strcmp(const void* str1, const void* str2);
...
@@ -122,6 +122,7 @@ ut_strcmp(const void* str1, const void* str2);
Copies up to size - 1 characters from the NUL-terminated string src to
Copies up to size - 1 characters from the NUL-terminated string src to
dst, NUL-terminating the result. Returns strlen(src), so truncation
dst, NUL-terminating the result. Returns strlen(src), so truncation
occurred if the return value >= size. */
occurred if the return value >= size. */
ulint
ulint
ut_strlcpy
(
ut_strlcpy
(
/*=======*/
/*=======*/
...
@@ -130,6 +131,18 @@ ut_strlcpy(
...
@@ -130,6 +131,18 @@ ut_strlcpy(
const
char
*
src
,
/* in: source buffer */
const
char
*
src
,
/* in: source buffer */
ulint
size
);
/* in: size of destination buffer */
ulint
size
);
/* in: size of destination buffer */
/**************************************************************************
Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last
(size - 1) bytes of src, not the first. */
ulint
ut_strlcpy_rev
(
/*===========*/
/* out: strlen(src) */
char
*
dst
,
/* in: destination buffer */
const
char
*
src
,
/* in: source buffer */
ulint
size
);
/* in: size of destination buffer */
/**************************************************************************
/**************************************************************************
Compute strlen(ut_strcpyq(str, q)). */
Compute strlen(ut_strcpyq(str, q)). */
UNIV_INLINE
UNIV_INLINE
...
...
innobase/mem/mem0mem.c
View file @
4676fc94
...
@@ -187,9 +187,7 @@ mem_heap_create_block(
...
@@ -187,9 +187,7 @@ mem_heap_create_block(
}
}
block
->
magic_n
=
MEM_BLOCK_MAGIC_N
;
block
->
magic_n
=
MEM_BLOCK_MAGIC_N
;
ut_memcpy
(
&
(
block
->
file_name
),
file_name
+
ut_strlen
(
file_name
)
-
7
,
ut_strlcpy_rev
(
block
->
file_name
,
file_name
,
sizeof
(
block
->
file_name
));
7
);
block
->
file_name
[
7
]
=
'\0'
;
block
->
line
=
line
;
block
->
line
=
line
;
#ifdef MEM_PERIODIC_CHECK
#ifdef MEM_PERIODIC_CHECK
...
...
innobase/ut/ut0mem.c
View file @
4676fc94
...
@@ -364,7 +364,30 @@ ut_strlcpy(
...
@@ -364,7 +364,30 @@ ut_strlcpy(
dst
[
n
]
=
'\0'
;
dst
[
n
]
=
'\0'
;
}
}
return
src_size
;
return
(
src_size
);
}
/**************************************************************************
Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last
(size - 1) bytes of src, not the first. */
ulint
ut_strlcpy_rev
(
/*===========*/
/* out: strlen(src) */
char
*
dst
,
/* in: destination buffer */
const
char
*
src
,
/* in: source buffer */
ulint
size
)
/* in: size of destination buffer */
{
ulint
src_size
=
strlen
(
src
);
if
(
size
!=
0
)
{
ulint
n
=
ut_min
(
src_size
,
size
-
1
);
memcpy
(
dst
,
src
+
src_size
-
n
,
n
+
1
);
}
return
(
src_size
);
}
}
/**************************************************************************
/**************************************************************************
...
...
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