Accessing vbo value in shader

Hi all,
I have a simple vbo which is setup as follows;

glGenBuffers( 1, &vbo);
glBindBuffer( GL_ARRAY_BUFFER, vbo);
unsigned int size = total_items * 4;
glBufferData( GL_ARRAY_BUFFER, size, 0, GL_STATIC_DRAW);
glBindBuffer( GL_ARRAY_BUFFER, 0);

Next, I put the data into the vbo as follows;

glBindBuffer(GL_ARRAY_BUFFER, vbo);
float* p =( float*)glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
for (int i=0; i<total_items; i++){
   int index  = i*4;
   p[index]   = data[count];	
   p[index+1] = data[count+1];
   p[index+2] = data[count+2];
   p[index+3] = 0; 

However, when I access the vertex position in my vertex shader, it returns the x component of the data instead of the explicit zero that I am setting in. My draw call is as follows

glBindBuffer( GL_ARRAY_BUFFER, vbo);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0);
glDrawArrays(GL_POINTS, 0, total_items);
glBindBuffer( GL_ARRAY_BUFFER, 0);

Am i doing anything wrong here?

One more thing, I dont know why but after a specific length the post editing pane automatically scrolls back up and its very difficult to edit the message.

I got it working the problem was else where. Some other part of code was messing the last parameter.

Thanks anyways,

I know you said you solved it, but

unsigned int size = total_items * 4;

should be

unsigned int size = total_items * 4 * sizeof(float);

as you seem to have total_items many vec4.

Thanks carsten for pointing this out. I missed that during the copy from my code.