Permalink
Browse files

small bug fixes

  • Loading branch information...
1 parent e77ac48 commit 20c758ae85daa5cfa0ad9276c6633b78e982f8b4 @samsonjs committed Jan 21, 2013
Showing with 3 additions and 2 deletions.
  1. +2 −2 asm/cstruct.rb
  2. +1 −0 test/test.rb
View
@@ -327,8 +327,8 @@ class MachHeader < CStruct
puts MachHeader::MemberSizes.inspect
puts "# of MachHeader members: " + MachHeader.size.to_s + ", size in bytes: " + MachHeader.bytesize.to_s
mh = MachHeader.new(0xfeedface, 7, 3, "foobar")
- %w[magic, cputype, cpusubtype, segname].each do |field|
- puts "#{field}(#{MachHeader.sizeof(field.to_sym)}): " + mh[field.to_sym].inspect
+ %w[magic cputype cpusubtype segname].each do |field|
+ puts "#{field}(#{MachHeader.sizeof(field.to_sym)}): #{mh[field.to_sym].inspect}"
end
puts mh.pack_pattern.inspect
binstr = mh.serialize
View
@@ -10,6 +10,7 @@
def main
func = ARGV.shift
outdir = ARGV.shift || '.'
+ Dir.mkdir(outdir) unless File.exists?(outdir)
binformat = (ARGV.shift || 'elf').downcase
format = (ARGV.shift || 'asm').downcase
platform = `uname -s`.chomp.downcase

0 comments on commit 20c758a

Please sign in to comment.