made alignment parameter mandatory
@@ -18,17 +18,20 @@ public class AlignProcessor implements Processor
@Override
public Resource execute(String[] fields) throws IOException
{
- if (fields.length < 2)
+ if (fields.length < 1)
{
System.out.println("Wrong ALIGN definition");
- System.out.println("ALIGN alignment");
- System.out.println(" alignment specifies the minimum binary data alignment in bytes");
+ System.out.println("ALIGN [alignment]");
+ System.out.println(
+ " alignment specifies the minimum binary data alignment in bytes (default is 524288)");
return null;
}
// get alignment
- final int alignment = StringUtil.parseInt(fields[1], 0);
+ int alignment = 524288;
+ if (fields.length > 1)
+ StringUtil.parseInt(fields[1], alignment);
// build ALIGN resource
return new Align("align", alignment);
