about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-10-12 09:48:47 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-10-12 09:48:47 -0700
commit3b158194a8fe2ea49843303a78649e0f5fac1320 (patch)
tree833d85d7411ce9018ffa070b73ac623149b72019 /subx
parentd331cded4ddfecef7f72a4ff1a6f1c7040515e3b (diff)
downloadmu-3b158194a8fe2ea49843303a78649e0f5fac1320.tar.gz
4028
Diffstat (limited to 'subx')
-rw-r--r--subx/010core.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/subx/010core.cc b/subx/010core.cc
index bb3919cf..d71df322 100644
--- a/subx/010core.cc
+++ b/subx/010core.cc
@@ -92,10 +92,10 @@ void run(const string& text_bytes) {
 }
 
 void load_program(const string& text_bytes) {
-  // now, to read the hex bytes in ASCII, we'll use C's strtol
-  // strtol needs a char*, so we grab the buffer backing the string object
   uint32_t addr = 1;
-  char* curr = const_cast<char*>(&text_bytes[0]);   // non-standard approach, but blessed by Herb Sutter (http://herbsutter.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/#comment-483)
+  // we'll use C's 'strtol` to parse ASCII hex bytes
+  // strtol needs a char*, so we grab the buffer backing the string object
+  char* curr = const_cast<char*>(&text_bytes[0]);   // non-portable, but blessed by Herb Sutter (http://herbsutter.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/#comment-483)
   char* max = curr + strlen(curr);
   while (curr < max) {
     // skip whitespace