summaryrefslogtreecommitdiffstats
path: root/edify/expr.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-06-18 19:11:50 +0200
committerDoug Zongker <dougz@android.com>2009-06-18 19:11:50 +0200
commit47cace98369f60df2351a65801c8065bb7f9dbf0 (patch)
treee030f48230e2e6e47204224018fc4c62db3d27ce /edify/expr.c
parentlet the "firmware" command take the file straight from the package (diff)
downloadandroid_bootable_recovery-47cace98369f60df2351a65801c8065bb7f9dbf0.tar
android_bootable_recovery-47cace98369f60df2351a65801c8065bb7f9dbf0.tar.gz
android_bootable_recovery-47cace98369f60df2351a65801c8065bb7f9dbf0.tar.bz2
android_bootable_recovery-47cace98369f60df2351a65801c8065bb7f9dbf0.tar.lz
android_bootable_recovery-47cace98369f60df2351a65801c8065bb7f9dbf0.tar.xz
android_bootable_recovery-47cace98369f60df2351a65801c8065bb7f9dbf0.tar.zst
android_bootable_recovery-47cace98369f60df2351a65801c8065bb7f9dbf0.zip
Diffstat (limited to '')
-rw-r--r--edify/expr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/edify/expr.c b/edify/expr.c
index f1c555552..72e5100f3 100644
--- a/edify/expr.c
+++ b/edify/expr.c
@@ -417,3 +417,16 @@ char** ReadVarArgs(State* state, int argc, Expr* argv[]) {
}
return args;
}
+
+// Use printf-style arguments to compose an error message to put into
+// *state. Returns NULL.
+char* ErrorAbort(State* state, char* format, ...) {
+ char* buffer = malloc(4096);
+ va_list v;
+ va_start(v, format);
+ vsnprintf(buffer, 4096, format, v);
+ va_end(v);
+ free(state->errmsg);
+ state->errmsg = buffer;
+ return NULL;
+}