Questions tagged [nul]

NUL is the abbreviation for the null character in several character sets

NUL has a value of 0 and is often written as the escape sequence \0. It is used as a terminator in standard strings.

179 questions
6
votes
4 answers

In C, is the condition : "if(a != NULL)" the same as the condition "if(a)"?

Let's say a is a pointer, and after allocating memory for it, I want to check if the memory was allocated successfully, I've seen two ways doing this : if(a != NULL) if(a) What is the difference between the first and second statements ?
Idan
  • 61
  • 3
5
votes
2 answers

ERROR: auto-makefile - NUL character / missing separator

OS: Mac OS X 10.7 (Lion) Program(IDE): Eclipse CDT I am currently learning advanced C++ using the eclipse development environment. (I have my reasons.) The problem at hand that I have been working at for several hours now is an error…
user1124893
5
votes
3 answers

psql --(record|field)-separator NUL

Is there some way to make psql separate the fields and records by \0, aka NUL? It's the only way to be able to pass arbitrary data to Bash scripts. Based on Matthew Wood's answer, I would expect this to print more that 1 on a newly initialized…
l0b0
  • 55,365
  • 30
  • 138
  • 223
5
votes
1 answer

Removing "NUL" characters (within R)

I've got a strange text file with a bunch of NUL characters in it (actually about 10 such files), and I'd like to programmatically replace them from within R. Here is a link to one of the files. With the aid of this question I've finally figured out…
MichaelChirico
  • 33,841
  • 14
  • 113
  • 198
5
votes
4 answers

What does write() write if null terminator is already reached?

For write(fd[1], string, size) - what would happen if string is shorter than size? I looked up the man page but it doesn't clearly specify that situation. I know that for read, it would simply stop there and read whatever string is, but it's…
Xufeng
  • 6,452
  • 8
  • 24
  • 30
4
votes
2 answers

read nul delimited fields

Given this file printf 'alpha\0bravo\0charlie' > delta.txt I would like to read the fields into separate variables. The reason I am using a null separator is because the fields will contain file paths, which can contain any character except null. I…
Zombo
  • 1
  • 62
  • 391
  • 407
4
votes
3 answers

Is there a sed type package in R for removing embedded NULs?

I am processing the US Weather service Storm Data, which has one large CSV data file for each year from 1950 onwards. The 1999 year file contains several rows with very large freeform text fields which contain embedded NUL characters, in an…
Bill
  • 5,600
  • 15
  • 27
4
votes
6 answers

returning NULL but getting error C2440: 'return' : cannot convert from 'int' to 'const &'

I've got a method that follows class BuildOrderStrategy { public: virtual const Urgency& getUrgency() = 0; ... } which implementation follows const Urgency& RandomBuildOrderStrategy::getUrgency() { return NULL; } but at compile time…
thiagoh
  • 7,098
  • 8
  • 51
  • 77
4
votes
1 answer

In SQL Server, replace a Char(0), the null character, embedded in a string with its hex code

What is a construct in SQL Server T-SQL that will replace a Char(0), the null character, embedded in a string with its hex code? I.e. REPLACE('t'+Char(0)+'t', Char(0), REPLACE(master.dbo.fn_varbintohexstr(0), '000000', '')) does not return…
Mark Hurd
  • 10,665
  • 10
  • 68
  • 101
3
votes
3 answers

Null check operator used on a null value in flutter getx

My code is giving the Null check operator used on a null value error although I can't found any null value in the code. I don't know which screen is actually causing the error but surely it is out of these two screens only which are Splash…
yogender
  • 202
  • 3
  • 12
3
votes
1 answer

Hashing a string containing the NUL character in C++ using crypto++

In C++ (C++11 to be precise), I would like to get the HMAC SHA512 hash of a string containing the NUL character (the ASCII character that has all eight of its bits set to 0). Using crypto++, so far my approach has been as follows: std::string…
John S.
  • 501
  • 2
  • 6
  • 17
3
votes
3 answers

Storing JQ NULL-delimited output in bash array

on bash 4.4.12 using jq 1.5 with this one-liner IFS=_ read -r -a a < <(jq -ncj '["a","b","c"][]+"_"') ; printf '%s\n' "${a[@]}" I get a properly delimited output a b c for elements a, b and c respectively, BUT if I try the same thing with a null…
GGets
  • 416
  • 6
  • 19
3
votes
0 answers

Memory allocation for entities in R only 2 GB?

Windows 10 64 bit, 32 GB RAM, Rstudio 1.1.383 and R 3.4.2 (up-to-date) I have several csv files which have at least 1 or 2 lines full of many nul values. So I wrote a script that uses read_lines_raw() from stringr package in R which reads the file…
ilyas
  • 609
  • 9
  • 25
3
votes
0 answers

yielding items from NUL separated input in python

I have a situation in python where I need to loop items from a NUL separated stream given in a format similar to the output of find /somewhere -print0 The stream is binary, items can consist of all bytes except NUL There is no way of knowing if the…
mossymountain
  • 175
  • 1
  • 7
3
votes
3 answers

Unable to understand this code from CodeGolf

So I was losing my week-end on StackOverflow and saw this challenge in the Hot Network Questions. Background Hello golfers! I would like to learn all the programming languages! But I kinda have a short attention span... and copying all the…
Badda
  • 1,329
  • 2
  • 15
  • 40
1
2
3
11 12