- if ( lun != -1 )
- {
- sprintf ( comp, "/@%lx,%lx:%ld';}", unit, lun, partition );
- }
- else
- {
- sprintf( comp, "/@%lx:%ld';}", unit, partition );
- }
- } else
- continue;
+ if ( lun != -1 )
+ {
+ len = strlen( "/@hhhhhhhh,hhhhhhhh:dddddddddd';}" );
+ maxLen -= len;
+ if( maxLen <= 0)
+ continue;
+
+ snprintf( comp, len + 1, "/@%lx,%lx:%ld';}", unit, lun, partition );
+ }
+ else
+ {
+ len = strlen( "/@hhhhhhhh:dddddddddd';}" );
+ maxLen -= len;
+ if( maxLen <= 0)
+ continue;
+
+ snprintf( comp, len + 1, "/@%lx:%ld';}", unit, partition );
+ }