Browse Source

Fortify against missing purpose

(Humanity could use that)
Alois Mahdal 10 years ago
parent
commit
ef0e500332
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      bin/mkexec

+ 3
- 1
bin/mkexec View File

@@ -124,7 +124,9 @@ sub mkbody {
124 124
     my $type = shift;
125 125
     my $purpose = shift;
126 126
     my $tmpl = "";
127
-    $tmpl .= $templates->{$type}->{$purpose} if exists $templates->{$type};
127
+    $tmpl .= $templates->{$type}->{$purpose}
128
+        if exists $templates->{$type}
129
+            and exists $templates->{$type}->{$purpose};
128 130
     return sprintf "#!%s\n%s\n", $bangs->{$type}, $tmpl;
129 131
 }
130 132