cmd: Use NUL/0 instead of 0x00

Frédéric Delanoy frederic.delanoy at gmail.com
Mon Sep 12 13:35:17 CDT 2011


---
 programs/cmd/batch.c     |   26 +++++++++++-----------
 programs/cmd/builtins.c  |   54 +++++++++++++++++++++++-----------------------
 programs/cmd/directory.c |    8 +++---
 programs/cmd/wcmdmain.c  |   48 ++++++++++++++++++++--------------------
 4 files changed, 68 insertions(+), 68 deletions(-)

diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c
index 881c7d1..85ce68b 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -322,8 +322,8 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
           /* Special case '$' to skip until : found */
           if (*lastModifier == '$') {
             while (*pos != ':' && *pos) pos++;
-            if (*pos == 0x00) return; /* Invalid syntax */
-            pos++;                    /* Skip ':'       */
+            if (!*pos) return; /* Invalid syntax */
+            pos++;             /* Skip ':'       */
           }
           break;
         }
@@ -374,7 +374,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
      points to the variable just after the modifiers. Process modifiers
      in a specific order, remembering there could be duplicates           */
   modifierLen = lastModifier - firstModifier;
-  finaloutput[0] = 0x00;
+  finaloutput[0] = '\0';
 
   /* Useful for debugging purposes: */
   /*printf("Modifier string '%*.*s' and variable is %c\n Param starts as '%s'\n",
@@ -386,7 +386,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
       memchrW(firstModifier, '~', modifierLen) != NULL) {
     int len = strlenW(outputparam);
     if (outputparam[len-1] == '"') {
-        outputparam[len-1]=0x00;
+        outputparam[len-1]='\0';
         len = len - 1;
     }
     memmove(outputparam, &outputparam[1], (len * sizeof(WCHAR))-1);
@@ -403,13 +403,13 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
 
     /* Extract the env var */
     memcpy(env, begin, (end-begin) * sizeof(WCHAR));
-    env[(end-begin)] = 0x00;
+    env[(end-begin)] = '\0';
 
     /* If env var not found, return empty string */
     if ((GetEnvironmentVariableW(env, fullpath, MAX_PATH) == 0) ||
         (SearchPathW(fullpath, outputparam, NULL, MAX_PATH, outputparam, NULL) == 0)) {
-      finaloutput[0] = 0x00;
-      outputparam[0] = 0x00;
+      finaloutput[0] = '\0';
+      outputparam[0] = '\0';
       skipFileParsing = TRUE;
     }
   }
@@ -456,7 +456,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
       int datelen;
 
       doneModifier = TRUE;
-      if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
+      if (finaloutput[0]) strcatW(finaloutput, space);
 
       /* Format the time */
       FileTimeToSystemTime(&fileInfo.ftLastWriteTime, &systime);
@@ -478,14 +478,14 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
       static const WCHAR fmt[] = {'%','u','\0'};
 
       doneModifier = TRUE;
-      if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
+      if (finaloutput[0]) strcatW(finaloutput, space);
       wsprintfW(thisoutput, fmt, fullsize);
       strcatW(finaloutput, thisoutput);
     }
 
     /* 4. Handle 's' : Use short paths (File doesn't have to exist) */
     if (memchrW(firstModifier, 's', modifierLen) != NULL) {
-      if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
+      if (finaloutput[0]) strcatW(finaloutput, space);
       /* Don't flag as doneModifier - %~s on its own is processed later */
       GetShortPathNameW(outputparam, outputparam, sizeof(outputparam)/sizeof(outputparam[0]));
     }
@@ -494,7 +494,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
     /*      Note this overrides d,p,n,x                                 */
     if (memchrW(firstModifier, 'f', modifierLen) != NULL) {
       doneModifier = TRUE;
-      if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
+      if (finaloutput[0]) strcatW(finaloutput, space);
       strcatW(finaloutput, fullfilename);
     } else {
 
@@ -504,7 +504,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
       WCHAR ext[MAX_PATH];
       BOOL doneFileModifier = FALSE;
 
-      if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
+      if (finaloutput[0]) strcatW(finaloutput, space);
 
       /* Split into components */
       WCMD_splitpath(fullfilename, drive, dir, fname, ext);
@@ -541,7 +541,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, const WCHAR *forVariable,
       if (!doneFileModifier &&
           memchrW(firstModifier, 's', modifierLen) != NULL) {
         doneModifier = TRUE;
-        if (finaloutput[0] != 0x00) strcatW(finaloutput, space);
+        if (finaloutput[0]) strcatW(finaloutput, space);
         strcatW(finaloutput, outputparam);
       }
     }
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 716db4b..4594a1a 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -352,7 +352,7 @@ void WCMD_copy (void) {
   WCHAR fname[MAX_PATH];
   WCHAR ext[MAX_PATH];
 
-  if (param1[0] == 0x00) {
+  if (!param1[0]) {
     WCMD_output (WCMD_LoadMessage(WCMD_NOARG));
     return;
   }
@@ -385,7 +385,7 @@ void WCMD_copy (void) {
 
   /* If no destination supplied, assume current directory */
   WINE_TRACE("Copy destination (supplied): '%s'\n", wine_dbgstr_w(param2));
-  if (param2[0] == 0x00) {
+  if (!param2[0]) {
       strcpyW(param2, dotW);
   }
 
@@ -520,7 +520,7 @@ void WCMD_create_dir (WCHAR *command) {
     int   argno = 0;
     WCHAR *argN = command;
 
-    if (param1[0] == 0x00) {
+    if (!param1[0]) {
         WCMD_output (WCMD_LoadMessage(WCMD_NOARG));
         return;
     }
@@ -607,7 +607,7 @@ static BOOL WCMD_delete_confirm_wildcard(const WCHAR *filename, BOOL *pPrompted)
 
         /* Only prompt for * and *.*, not *a, a*, *.a* etc */
         if ((strcmpW(fname, starW) == 0) &&
-            (*ext == 0x00 || (strcmpW(ext, anyExt) == 0))) {
+            (!*ext || (strcmpW(ext, anyExt) == 0))) {
 
             WCHAR question[MAXSTRING];
             static const WCHAR fmt[] = {'%','s',' ','\0'};
@@ -747,12 +747,12 @@ static BOOL WCMD_delete_one (const WCHAR *thisArg) {
 
       /* Append '*' to the directory */
       thisDir[cPos] = '*';
-      thisDir[cPos+1] = 0x00;
+      thisDir[cPos+1] = '\0';
 
       hff = FindFirstFileW(thisDir, &fd);
 
       /* Remove residual '*' */
-      thisDir[cPos] = 0x00;
+      thisDir[cPos] = '\0';
 
       if (hff != INVALID_HANDLE_VALUE) {
         DIRECTORY_STACK *allDirs = NULL;
@@ -976,7 +976,7 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
   i = 0;
   while (curPos[i] && curPos[i]!=' ' && curPos[i]!='\t') i++;
   memcpy(&variable[0], curPos, i*sizeof(WCHAR));
-  variable[i] = 0x00;
+  variable[i] = '\0';
   WINE_TRACE("Variable identified as %s\n", wine_dbgstr_w(variable));
   curPos = &curPos[i];
 
@@ -1099,7 +1099,7 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
               static const WCHAR cmdW[]     = {'C','M','D','\0'};
 
               /* Remove trailing character */
-              itemStart[strlenW(itemStart)-1] = 0x00;
+              itemStart[strlenW(itemStart)-1] = '\0';
 
               /* Get temp filename */
               GetTempPathW(sizeof(temp_path)/sizeof(WCHAR), temp_path);
@@ -1146,7 +1146,7 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
                   cmdEnd = thisCmdStart;
               }
 
-              buffer[0] = 0x00;
+              buffer[0] = '\0';
 
             }
             CloseHandle (input);
@@ -1376,7 +1376,7 @@ void WCMD_goto (CMD_LIST **cmdList) {
     WCHAR *paramStart = param1, *str;
     static const WCHAR eofW[] = {':','e','o','f','\0'};
 
-    if (param1[0] == 0x00) {
+    if (!param1[0]) {
       WCMD_output (WCMD_LoadMessage(WCMD_NOARG));
       return;
     }
@@ -1564,13 +1564,13 @@ void WCMD_move (void) {
   WCHAR            fname[MAX_PATH];
   WCHAR            ext[MAX_PATH];
 
-  if (param1[0] == 0x00) {
+  if (!param1[0]) {
     WCMD_output (WCMD_LoadMessage(WCMD_NOARG));
     return;
   }
 
   /* If no destination supplied, assume current directory */
-  if (param2[0] == 0x00) {
+  if (!param2[0]) {
       strcpyW(param2, dotW);
   }
 
@@ -1785,7 +1785,7 @@ void WCMD_rename (void) {
   errorlevel = 0;
 
   /* Must be at least two args */
-  if (param1[0] == 0x00 || param2[0] == 0x00) {
+  if (!param1[0] || !param2[0]) {
     WCMD_output (WCMD_LoadMessage(WCMD_NOARG));
     errorlevel = 1;
     return;
@@ -1835,10 +1835,10 @@ void WCMD_rename (void) {
     /* Build name */
     if (param2[0] == '*') {
       strcatW(dest, fd.cFileName);
-      if (dotSrc) dest[dirLen + (dotSrc - fd.cFileName)] = 0x00;
+      if (dotSrc) dest[dirLen + (dotSrc - fd.cFileName)] = '\0';
     } else {
       strcatW(dest, param2);
-      if (dotDst) dest[dirLen + (dotDst - param2)] = 0x00;
+      if (dotDst) dest[dirLen + (dotDst - param2)] = '\0';
     }
 
     /* Build Extension */
@@ -2052,7 +2052,7 @@ void WCMD_setshow_default (const WCHAR *command) {
     }
     while (pos > command && (*(pos-1) == ' ' || *(pos-1) == '\t'))
       pos--;
-    *pos = 0x00;
+    *pos = '\0';
 
     /* Search for appropriate directory */
     WINE_TRACE("Looking for directory '%s'\n", wine_dbgstr_w(string));
@@ -2115,7 +2115,7 @@ void WCMD_setshow_default (const WCHAR *command) {
       WCHAR env[4];
       strcpyW(env, equalW);
       memcpy(env+1, string, 2 * sizeof(WCHAR));
-      env[3] = 0x00;
+      env[3] = '\0';
       WINE_TRACE("Setting '%s' to '%s'\n", wine_dbgstr_w(env), wine_dbgstr_w(string));
       SetEnvironmentVariableW(env, string);
     }
@@ -2233,7 +2233,7 @@ void WCMD_setshow_env (WCHAR *s) {
   int status;
   static const WCHAR parmP[] = {'/','P','\0'};
 
-  if (param1[0] == 0x00 && quals[0] == 0x00) {
+  if (!param1[0] && !quals[0]) {
     env = GetEnvironmentStringsW();
     WCMD_setshow_sortenv( env, NULL );
     return;
@@ -2441,12 +2441,12 @@ void WCMD_type (WCHAR *command) {
   WCHAR *argN          = command;
   BOOL  writeHeaders  = FALSE;
 
-  if (param1[0] == 0x00) {
+  if (!param1[0]) {
     WCMD_output (WCMD_LoadMessage(WCMD_NOARG));
     return;
   }
 
-  if (param2[0] != 0x00) writeHeaders = TRUE;
+  if (param2[0]) writeHeaders = TRUE;
 
   /* Loop through all args */
   errorlevel = 0;
@@ -2507,7 +2507,7 @@ void WCMD_more (WCHAR *command) {
   LoadStringW(hinst, WCMD_MORESTR, &moreStr[3],
               (sizeof(moreStr)/sizeof(WCHAR))-3);
 
-  if (param1[0] == 0x00) {
+  if (!param1[0]) {
 
     /* Wine implements pipes via temporary files, and hence stdin is
        effectively reading from the file. This means the prompts for
@@ -2747,7 +2747,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
     }
 
     /* If no parameters then list all associations */
-    if (*command == 0x00) {
+    if (!*command) {
       int index = 0;
 
       /* Enumerate all the keys */
@@ -2797,7 +2797,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
         /* Query terminates the parameter at the first space */
         strcpyW(keyValue, command);
         space = strchrW(keyValue, ' ');
-        if (space) *space=0x00;
+        if (space) *space = '\0';
 
         /* Set up key name */
         strcpyW(subkey, keyValue);
@@ -2834,7 +2834,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
         WCHAR subkey[MAXSTRING];
 
         /* Get pointer to new value */
-        *newValue = 0x00;
+        *newValue = '\0';
         newValue++;
 
         /* Set up key name */
@@ -2842,7 +2842,7 @@ void WCMD_assoc (const WCHAR *command, BOOL assoc) {
         if (!assoc) strcatW(subkey, shOpCmdW);
 
         /* If nothing after '=' then clear value - only valid for ASSOC */
-        if (*newValue == 0x00) {
+        if (!*newValue) {
 
           if (assoc) rc = RegDeleteKeyW(key, command);
           if (assoc && rc == ERROR_SUCCESS) {
@@ -2910,7 +2910,7 @@ void WCMD_color (void) {
   CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
   HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
 
-  if (param1[0] != 0x00 && strlenW(param1) > 2) {
+  if (param1[0] && strlenW(param1) > 2) {
     WCMD_output (WCMD_LoadMessage(WCMD_ARGERR));
     return;
   }
@@ -2927,7 +2927,7 @@ void WCMD_color (void) {
       topLeft.Y = 0;
 
       /* Convert the color hex digits */
-      if (param1[0] == 0x00) {
+      if (!param1[0]) {
         color = defaultColor;
       } else {
         color = strtoulW(param1, NULL, 16);
diff --git a/programs/cmd/directory.c b/programs/cmd/directory.c
index 1863690..2b12a61 100644
--- a/programs/cmd/directory.c
+++ b/programs/cmd/directory.c
@@ -208,7 +208,7 @@ static void WCMD_getfileowner(WCHAR *filename, WCHAR *owner, int ownerlen) {
     WCHAR domain[MAXSTRING];
 
     /* In case of error, return empty string */
-    *owner = 0x00;
+    *owner = '\0';
 
     /* Find out how much space we need for the owner security descriptor */
     GetFileSecurityW(filename, OWNER_SECURITY_INFORMATION, 0, 0, &sizeNeeded);
@@ -332,7 +332,7 @@ static DIRECTORY_STACK *WCMD_list_directory (DIRECTORY_STACK *inputparms, int le
 
     /* Work out the actual current directory name without a trailing \ */
     strcpyW(real_path, parms->dirName);
-    real_path[strlenW(parms->dirName)-1] = 0x00;
+    real_path[strlenW(parms->dirName)-1] = '\0';
 
     /* Output the results */
     if (!bare) {
@@ -731,7 +731,7 @@ void WCMD_directory (WCHAR *cmd) {
               else if (*p == 'W') dirTime = Written;
 
               /* Support /T and /T: with no parms, default to written */
-              else if (*p == 0x00 || *p == '/') {
+              else if (!*p || *p == '/') {
                 dirTime = Written;
                 p = p - 1; /* So when step on, move to '/' */
               } else {
@@ -949,7 +949,7 @@ void WCMD_directory (WCHAR *cmd) {
 
          WINE_TRACE("Writing volume for '%c:'\n", thisEntry->dirName[0]);
          memcpy(drive, thisEntry->dirName, 2 * sizeof(WCHAR));
-         drive[2] = 0x00;
+         drive[2] = '\0';
          status = WCMD_volume (0, drive);
          trailerReqd = TRUE;
          if (!status) {
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 840c5da..b2715c3 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -552,7 +552,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
     WCHAR *colonpos = NULL;
     WCHAR thisVar[MAXSTRING];
     WCHAR thisVarContents[MAXSTRING];
-    WCHAR savedchar = 0x00;
+    WCHAR savedchar = '\0';
     int len;
 
     static const WCHAR ErrorLvl[]  = {'E','R','R','O','R','L','E','V','E','L','\0'};
@@ -591,7 +591,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
     }
 
     memcpy(thisVar, start, ((endOfVar - start) + 1) * sizeof(WCHAR));
-    thisVar[(endOfVar - start)+1] = 0x00;
+    thisVar[(endOfVar - start)+1] = '\0';
     colonpos = strchrW(thisVar+1, ':');
 
     /* If there's complex substitution, just need %var% for now
@@ -599,7 +599,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
     if (colonpos) {
         *colonpos = '%';
         savedchar = *(colonpos+1);
-        *(colonpos+1) = 0x00;
+        *(colonpos+1) = '\0';
     }
 
     WINE_TRACE("Retrieving contents of %s\n", wine_dbgstr_w(thisVar));
@@ -667,7 +667,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
         WCMD_strsubstW(start, endOfVar + 1, NULL, 0);
       } else {
         len = strlenW(thisVar);
-        thisVar[len-1] = 0x00;
+        thisVar[len-1] = '\0';
         /* If %:...% supplied, : is retained */
         if (colonpos == thisVar+1) {
           WCMD_strsubstW(start, endOfVar + 1, colonpos, -1);
@@ -744,8 +744,8 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
       s = WCMD_strdupW(endOfVar + 1);
 
       /* Null terminate both strings */
-      thisVar[strlenW(thisVar)-1] = 0x00;
-      *equalspos = 0x00;
+      thisVar[strlenW(thisVar)-1] = '\0';
+      *equalspos = '\0';
 
       /* Since we need to be case insensitive, copy the 2 buffers */
       searchIn  = WCMD_strdupW(thisVarContents);
@@ -774,7 +774,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start,
         WCHAR *lastFound = searchIn;
         WCHAR *outputposn = start;
 
-        *start = 0x00;
+        *start = '\0';
         while ((found = strstrW(lastFound, searchFor))) {
             lstrcpynW(outputposn,
                     thisVarContents + (lastFound-searchIn),
@@ -1049,7 +1049,7 @@ void WCMD_run_program (WCHAR *command, int called) {
 
     /* Reduce pathtosearch to a path with trailing '\' to support c:\a.bat and
        c:\windows\a.bat syntax                                                 */
-    if (lastSlash) *(lastSlash + 1) = 0x00;
+    if (lastSlash) *(lastSlash + 1) = '\0';
   }
 
   /* Now extract PATHEXT */
@@ -1077,7 +1077,7 @@ void WCMD_run_program (WCHAR *command, int called) {
     pos = strchrW(pathposn, ';');
     if (pos) {
       memcpy(thisDir, pathposn, (pos-pathposn) * sizeof(WCHAR));
-      thisDir[(pos-pathposn)] = 0x00;
+      thisDir[(pos-pathposn)] = '\0';
       pathposn = pos+1;
 
     } else {
@@ -1121,7 +1121,7 @@ void WCMD_run_program (WCHAR *command, int called) {
 
           if (nextExt) {
             memcpy(pos, thisExt, (nextExt-thisExt) * sizeof(WCHAR));
-            pos[(nextExt-thisExt)] = 0x00;
+            pos[(nextExt-thisExt)] = '\0';
             thisExt = nextExt+1;
           } else {
             strcpyW(pos, thisExt);
@@ -1343,7 +1343,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
  */
 
     /* STDIN could come from a preceding pipe, so delete on close if it does */
-    if (cmdList && (*cmdList)->pipeFile[0] != 0x00) {
+    if (cmdList && (*cmdList)->pipeFile[0]) {
         WINE_TRACE("Input coming from %s\n", wine_dbgstr_w((*cmdList)->pipeFile));
         h = CreateFileW((*cmdList)->pipeFile, GENERIC_READ,
                   FILE_SHARE_READ, &sa, OPEN_EXISTING,
@@ -1357,7 +1357,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
         SetStdHandle (STD_INPUT_HANDLE, h);
 
         /* No need to remember the temporary name any longer once opened */
-        (*cmdList)->pipeFile[0] = 0x00;
+        (*cmdList)->pipeFile[0] = '\0';
 
     /* Otherwise STDIN could come from a '<' redirect */
     } else if ((p = strchrW(new_redir,'<')) != NULL) {
@@ -1660,14 +1660,14 @@ static void WCMD_addCommand(WCHAR *command, int *commandLen,
         thisEntry->command = HeapAlloc(GetProcessHeap(), 0,
                                       (*commandLen+1) * sizeof(WCHAR));
         memcpy(thisEntry->command, command, *commandLen * sizeof(WCHAR));
-        thisEntry->command[*commandLen] = 0x00;
+        thisEntry->command[*commandLen] = '\0';
 
         /* Copy in the redirects */
         thisEntry->redirects = HeapAlloc(GetProcessHeap(), 0,
                                          (*redirLen+1) * sizeof(WCHAR));
         memcpy(thisEntry->redirects, redirs, *redirLen * sizeof(WCHAR));
-        thisEntry->redirects[*redirLen] = 0x00;
-        thisEntry->pipeFile[0] = 0x00;
+        thisEntry->redirects[*redirLen] = '\0';
+        thisEntry->pipeFile[0] = '\0';
 
         /* Reset the lengths */
         *commandLen   = 0;
@@ -1678,7 +1678,7 @@ static void WCMD_addCommand(WCHAR *command, int *commandLen,
     } else {
         thisEntry->command = NULL;
         thisEntry->redirects = NULL;
-        thisEntry->pipeFile[0] = 0x00;
+        thisEntry->pipeFile[0] = '\0';
     }
 
     /* Fill in other fields */
@@ -1849,7 +1849,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
     lastWasRedirect = FALSE;  /* Required for eg spaces between > and filename */
 
     /* Parse every character on the line being processed */
-    while (*curPos != 0x00) {
+    while (*curPos) {
 
       WCHAR thisChar;
 
@@ -1972,7 +1972,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
                         && (*(curPos-1)>='1') && (*(curPos-1)<='9')
                         && ((*(curPos-2)==' ') || (*(curPos-2)=='\t'))) {
                     curStringLen--;
-                    curString[curStringLen] = 0x00;
+                    curString[curStringLen] = '\0';
                     curCopyTo[(*curLen)++] = *(curPos-1);
                 }
 
@@ -2146,7 +2146,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
       }
 
       /* If we have reached the end, add this command into the list */
-      if (*curPos == 0x00 && *curLen > 0) {
+      if (!*curPos && *curLen > 0) {
 
           /* Add an entry to the command list */
           WCMD_addCommand(curString, &curStringLen,
@@ -2157,14 +2157,14 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
       }
 
       /* If we have reached the end of the string, see if bracketing outstanding */
-      if (*curPos == 0x00 && curDepth > 0 && readFrom != INVALID_HANDLE_VALUE) {
+      if (!*curPos && curDepth > 0 && readFrom != INVALID_HANDLE_VALUE) {
         inRem = FALSE;
         prevDelim = CMD_NONE;
         inQuotes = 0;
-        memset(extraSpace, 0x00, (MAXSTRING+1) * sizeof(WCHAR));
+        memset(extraSpace, 0, (MAXSTRING+1) * sizeof(WCHAR));
 
         /* Read more, skipping any blank lines */
-        while (*extraSpace == 0x00) {
+        while (!*extraSpace) {
           if (!context) WCMD_output_asis( WCMD_LoadMessage(WCMD_MOREPROMPT));
           if (WCMD_fgets(extraSpace, MAXSTRING, readFrom) == NULL) break;
         }
@@ -2489,7 +2489,7 @@ int wmain (int argc, WCHAR *argvW[])
   if (opt_t) {
       if (!(((opt_t & 0xF0) >> 4) == (opt_t & 0x0F))) {
           defaultColor = opt_t & 0xFF;
-          param1[0] = 0x00;
+          param1[0] = '\0';
           WCMD_color();
       }
   } else {
@@ -2551,7 +2551,7 @@ int wmain (int argc, WCHAR *argvW[])
       /* If one found, set the screen to that colour */
       if (!(((value & 0xF0) >> 4) == (value & 0x0F))) {
           defaultColor = value & 0xFF;
-          param1[0] = 0x00;
+          param1[0] = '\0';
           WCMD_color();
       }
 
-- 
1.7.6




More information about the wine-patches mailing list