summaryrefslogtreecommitdiffhomepage
path: root/contrib/lar/lar.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/lar/lar.c')
-rw-r--r--contrib/lar/lar.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/lar/lar.c b/contrib/lar/lar.c
index ad6cfc8e5..839b29299 100644
--- a/contrib/lar/lar.c
+++ b/contrib/lar/lar.c
@@ -183,7 +183,7 @@ lar_archive * lar_find_archive( const char *package )
for( len = 0; package[len] != '\0'; len++ )
{
- if( len >= sizeof(buffer) )
+ if( len >= (sizeof(buffer) - 5) )
LAR_DIE("Package name exceeds maximum allowed length");
if( package[len] == '.' ) seg++;
@@ -197,7 +197,7 @@ lar_archive * lar_find_archive( const char *package )
if( j < seg ) j++; else break;
}
- buffer[i] = ( package[i] == '.' ) ? '/' : package[i];
+ buffer[i] = ( package[i] == '.' ) ? LAR_DIRSEP : package[i];
}
buffer[i+0] = '.'; buffer[i+1] = 'l'; buffer[i+2] = 'a';
@@ -219,7 +219,7 @@ lar_member * lar_find_member( lar_archive *ar, const char *package )
for( len = 0; package[len] != '\0'; len++ )
{
- if( len >= sizeof(buffer) )
+ if( len >= (sizeof(buffer) - 5) )
LAR_DIE("Package name exceeds maximum allowed length");
buffer[len] = ( package[len] == '.' ) ? '/' : package[len];