Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
11884b88
Commit
11884b88
authored
May 28, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added strnlen replacement (Untested)
Revert back mp4 r20330 !
parent
11db57b5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
12 deletions
+31
-12
configure.ac
configure.ac
+1
-1
include/vlc_common.h
include/vlc_common.h
+7
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+12
-11
src/extras/libc.c
src/extras/libc.c
+11
-0
No files found.
configure.ac
View file @
11884b88
...
...
@@ -463,7 +463,7 @@ need_libc=false
AC_CHECK_FUNCS(gettimeofday strtod strtol strtof strtoll strtoull strsep isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon scandir fork bsearch lstat strlcpy)
dnl Check for usual libc functions
AC_CHECK_FUNCS(strdup strndup atof)
AC_CHECK_FUNCS(strdup strndup
strnlen
atof)
AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
...
...
include/vlc_common.h
View file @
11884b88
...
...
@@ -871,6 +871,13 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
# define vlc_strndup NULL
#endif
#ifndef HAVE_STRNLEN
# define strnlen vlc_strnlen
VLC_EXPORT
(
size_t
,
vlc_strnlen
,
(
const
char
*
,
size_t
)
);
#elif !defined(__PLUGIN__)
# define vlc_strnlen NULL
#endif
#ifndef HAVE_STRLCPY
# define strlcpy vlc_strlcpy
VLC_EXPORT
(
size_t
,
vlc_strlcpy
,
(
char
*
,
const
char
*
,
size_t
)
);
...
...
modules/demux/mp4/libmp4.c
View file @
11884b88
...
...
@@ -62,13 +62,14 @@
MP4_GET3BYTES( p_void->i_flags )
#define MP4_GETSTRINGZ( p_str ) \
if( (
i_read > 0 )&&(p_peek[0] ) )
\
if( (
i_read > 0) && (p_peek[0]) )
\
{ \
p_str = calloc( sizeof( char ), __MIN( strlen( (char*)p_peek ), i_read )+1);\
memcpy( p_str, p_peek, __MIN( strlen( (char*)p_peek ), i_read ) ); \
p_str[__MIN( strlen( (char*)p_peek ), i_read )] = 0; \
p_peek += strlen( (char *)p_str ) + 1; \
i_read -= strlen( (char *)p_str ) + 1; \
const int __i_copy__ = strnlen( (char*)p_peek, i_read-1 ); \
p_str = calloc( sizeof(char), __i_copy__+1 ); \
if( __i_copy__ > 0 ) memcpy( p_str, p_peek, __i_copy__ ); \
p_str[__i_copy__] = 0; \
p_peek += __i_copy__ + 1; \
i_read -= __i_copy__ + 1; \
} \
else \
{ \
...
...
src/extras/libc.c
View file @
11884b88
...
...
@@ -112,6 +112,17 @@ char *vlc_strndup( const char *string, size_t n )
}
#endif
/*****************************************************************************
* strnlen:
*****************************************************************************/
#if !defined( HAVE_STRNLEN )
size_t
vlc_strnlen
(
const
char
*
psz
,
size_t
n
)
{
const
char
*
psz_end
=
memchr
(
psz
,
0
,
n
);
return
psz_end
?
(
psz_end
-
psz
)
:
n
;
}
#endif
/*****************************************************************************
* strcasecmp: compare two strings ignoring case
*****************************************************************************/
...
...
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